decodebin3: Don't leak filter caps
authorEdward Hervey <edward@centricular.com>
Thu, 19 Nov 2020 13:35:32 +0000 (14:35 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 19 Nov 2020 13:36:19 +0000 (14:36 +0100)
Introduced by previous commit

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/933

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/934>

gst/playback/gstdecodebin3-parse.c

index 1c23d0d..532907d 100644 (file)
@@ -143,12 +143,14 @@ static GstCaps *
 get_parser_caps_filter (GstDecodebin3 * dbin, GstCaps * caps)
 {
   GList *tmp;
-  GstCaps *filter_caps = gst_caps_new_empty ();
+  GstCaps *filter_caps;
 
   /* If no filter was provided, it can handle anything */
   if (!caps || gst_caps_is_any (caps))
     return gst_caps_new_any ();
 
+  filter_caps = gst_caps_new_empty ();
+
   g_mutex_lock (&dbin->factories_lock);
   gst_decode_bin_update_factories_list (dbin);
   for (tmp = dbin->decoder_factories; tmp; tmp = tmp->next) {