parsebin: Avoid crash with unknown streams
authorEdward Hervey <edward@centricular.com>
Mon, 1 Aug 2022 15:25:56 +0000 (17:25 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 1 Aug 2022 22:52:42 +0000 (22:52 +0000)
With the new addition of handling unknown sream types we *could* end up with a
chain which doesn't have a current_pad (it's an intermediary one)

Fixes #1287

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

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

index d848094..0f442b2 100644 (file)
@@ -3774,6 +3774,9 @@ gst_parse_chain_expose (GstParseChain * chain, GList ** endpads,
   if (!group) {
     GstParsePad *p = chain->current_pad;
 
+    if (!p)
+      return FALSE;
+
     if (p->active_stream && p->active_collection == NULL
         && !p->in_a_fallback_collection)
       *uncollected_streams = TRUE;