ssaparse: Fix buffer leak in error case 56/191756/2
authorSatya Prakash Gupta <sp.gupta@samsung.com>
Mon, 24 Jul 2017 07:53:17 +0000 (13:23 +0530)
committereunhae choi <eunhae1.choi@samsung.com>
Tue, 23 Oct 2018 08:13:07 +0000 (08:13 +0000)
from upstream patch
https://bugzilla.gnome.org/show_bug.cgi?id=785331

Change-Id: I9cbe6fc1492c9c544eb056a5f277f2d663d4b5d7

gst/subparse/gstssaparse.c

index 9b00e79..c849c08 100644 (file)
@@ -169,8 +169,10 @@ gst_ssa_parse_setcaps (GstPad * sinkpad, GstCaps * caps)
 
   gst_buffer_ref (priv);
 
-  if (!gst_buffer_map (priv, &map, GST_MAP_READ))
+  if (!gst_buffer_map (priv, &map, GST_MAP_READ)) {
+    gst_buffer_unref (priv);
     return FALSE;
+  }
 
   GST_MEMDUMP_OBJECT (parse, "init section", map.data, map.size);