adaptivedemux2: Fix collection leaks
authorEdward Hervey <edward@centricular.com>
Mon, 31 Oct 2022 15:08:23 +0000 (16:08 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 4 Nov 2022 17:59:21 +0000 (17:59 +0000)
* The collection on the period was never unreffed
* The collection in the message handler was never unreffed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>

subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-period.c
subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c

index 2adf12d..35925cf 100644 (file)
@@ -53,6 +53,9 @@ _demux_period_free (GstAdaptiveDemuxPeriod * period)
   /* Disable and remove all streams and tracks. */
   g_list_free_full (period->streams, (GDestroyNotify) gst_object_unref);
 
+  if (period->collection)
+    gst_object_unref (period->collection);
+
   /* Theoretically all tracks should have gone by now */
   GST_DEBUG ("Disabling and removing all tracks");
   g_list_free_full (period->tracks,
index 07619bc..622ebf2 100644 (file)
@@ -1509,6 +1509,8 @@ gst_adaptive_demux_handle_stream_collection_msg (GstAdaptiveDemux * demux,
 beach:
   GST_MANIFEST_UNLOCK (demux);
 
+  if (collection)
+    gst_object_unref (collection);
   gst_message_unref (msg);
   msg = NULL;
 }