From cd728627af821de210f08463c8fb25157c9cabf8 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 2 Apr 2012 15:25:16 +0200 Subject: [PATCH] mpegtsbase: Don't leak corrupt section packet buffer --- gst/mpegtsdemux/mpegtsbase.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c index 345357a418..7193429d95 100644 --- a/gst/mpegtsdemux/mpegtsbase.c +++ b/gst/mpegtsdemux/mpegtsbase.c @@ -1399,9 +1399,11 @@ mpegts_base_chain (GstPad * pad, GstBuffer * buf) based = mpegts_base_handle_psi (base, §ion); 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, §ion);