From a336181ef5bba20b832fb3db6493ac737beb4bf2 Mon Sep 17 00:00:00 2001 From: Etienne Peron Date: Wed, 10 Jun 2015 14:18:00 +0200 Subject: [PATCH] tsdemux: Fix pad leak when the pad is never exposed If tsdemux never receives data for a stream, the corresponding pad will never be added and stream->active will remain FALSE. When the stream is removed, the pad will not be unreffed and will be leaked. https://bugzilla.gnome.org/show_bug.cgi?id=757873 --- gst/mpegtsdemux/tsdemux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 6b14a4f..085b83e 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -1665,6 +1665,8 @@ gst_ts_demux_stream_removed (MpegTSBase * base, MpegTSBaseStream * bstream) GST_DEBUG_OBJECT (stream->pad, "Removing pad"); gst_element_remove_pad (GST_ELEMENT_CAST (base), stream->pad); stream->active = FALSE; + } else { + gst_object_unref (stream->pad); } stream->pad = NULL; } -- 2.7.4