adaptivedemux2: Fix parent object leak
authorRafał Dzięgiel <rafostar.github@gmail.com>
Sun, 13 Nov 2022 11:18:54 +0000 (12:18 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sun, 13 Nov 2022 11:35:09 +0000 (11:35 +0000)
gst_object_get_parent() method is transfer-full, thus unref is needed

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

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

index 622ebf2..b465ac3 100644 (file)
@@ -652,7 +652,10 @@ gst_adaptive_demux_check_streams_aware (GstAdaptiveDemux * demux)
   gboolean ret = FALSE;
   GstObject *parent = gst_object_get_parent (GST_OBJECT (demux));
 
-  ret = (parent && GST_OBJECT_FLAG_IS_SET (parent, GST_BIN_FLAG_STREAMS_AWARE));
+  if (parent) {
+    ret = GST_OBJECT_FLAG_IS_SET (parent, GST_BIN_FLAG_STREAMS_AWARE);
+    gst_object_unref (parent);
+  }
 
   return ret;
 }