playbackutils: Fix caps leak in get_n_common_capsfeatures()
authorPhilippe Normand <philn@igalia.com>
Sat, 16 Nov 2024 18:24:23 +0000 (18:24 +0000)
committerBackport Bot <gitlab-backport-bot@gstreamer-foundation.org>
Sun, 17 Nov 2024 10:36:26 +0000 (10:36 +0000)
The gst_static_caps_get() return value is transfer-full.

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

subprojects/gst-plugins-base/gst/playback/gstplaybackutils.c

index 3b2fa50d43a31d7c1c0744a706b57ef3d4172a72..b63a2d22acb2f331bd2068d6637bf336b993a4eb 100644 (file)
@@ -86,6 +86,7 @@ gst_playback_utils_get_n_common_capsfeatures (GstElementFactory * fact1,
       gst_caps_unref (fact1_tmpl_caps);
     else if (fact2_tmpl_caps)
       gst_caps_unref (fact2_tmpl_caps);
+    gst_clear_caps (&raw_caps);
     return 0;
   }
 
@@ -132,6 +133,7 @@ gst_playback_utils_get_n_common_capsfeatures (GstElementFactory * fact1,
 
   gst_caps_unref (fact1_tmpl_caps);
   gst_caps_unref (fact2_tmpl_caps);
+  gst_clear_caps (&raw_caps);
 
   return n_common_cf;
 }