transcodebin: fix caps NULL unref
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>
Thu, 16 Apr 2020 16:17:56 +0000 (16:17 +0000)
committerThibault Saunier <tsaunier@igalia.com>
Thu, 16 Apr 2020 16:17:56 +0000 (16:17 +0000)
gst_pad_get_current_caps() can return a NULL pointer which was raisin a CRITICAL.

gst/transcode/gsttranscodebin.c

index 2df811f..1a310af 100644 (file)
@@ -271,7 +271,7 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstTranscodeBin * self)
               "sink-pad", GST_TYPE_PAD, sinkpad,
               "sink-caps", GST_TYPE_CAPS, othercaps, NULL));
 
-      gst_caps_unref (caps);
+      gst_clear_caps (&caps);
       if (othercaps)
         gst_caps_unref (othercaps);
     }