mpegtsbase: Don't leak corrupt section packet buffer
authorEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 2 Apr 2012 13:25:16 +0000 (15:25 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 2 Apr 2012 13:25:16 +0000 (15:25 +0200)
gst/mpegtsdemux/mpegtsbase.c

index 345357a41877ed8d140b967a22920489d97832ea..7193429d95406d5bcc4067fa2ace01923710bc87 100644 (file)
@@ -1399,9 +1399,11 @@ mpegts_base_chain (GstPad * pad, GstBuffer * buf)
         based = mpegts_base_handle_psi (base, &section);
         gst_buffer_unref (section.buffer);
 
-        if (G_UNLIKELY (!based))
+        if (G_UNLIKELY (!based)) {
+          gst_buffer_unref (packet.buffer);
           /* bad PSI table */
           goto next;
+        }
       }
       /* we need to push section packet downstream */
       res = mpegts_base_push (base, &packet, &section);