From: Vivia Nikolaidou Date: Thu, 11 Jun 2020 10:50:38 +0000 (+0300) Subject: interlace: Fix crash with empty caps in setcaps X-Git-Tag: 1.19.3~507^2~1768 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=969e6479252b787e37c62408464f050099565c5c;p=platform%2Fupstream%2Fgstreamer.git interlace: Fix crash with empty caps in setcaps If the src_peer_caps are EMPTY (e.g. negotiation failed somewhere), the assertion inside gst_video_info_from_caps would fail and the whole pipeline would crash. Check for gst_caps_is_empty before gst_video_info_from_caps and gracefully fail if it's empty. Part-of: --- diff --git a/gst/interlace/gstinterlace.c b/gst/interlace/gstinterlace.c index 635a99b..a15de74 100644 --- a/gst/interlace/gstinterlace.c +++ b/gst/interlace/gstinterlace.c @@ -427,8 +427,14 @@ gst_interlace_setcaps (GstInterlace * interlace, GstCaps * caps) src_peer_caps = gst_pad_peer_query_caps (interlace->srcpad, othercaps); gst_caps_unref (othercaps); othercaps = gst_caps_fixate (src_peer_caps); - if (!gst_video_info_from_caps (&out_info, othercaps)) + if (gst_caps_is_empty (othercaps)) { + gst_caps_unref (othercaps); goto caps_error; + } + if (!gst_video_info_from_caps (&out_info, othercaps)) { + gst_caps_unref (othercaps); + goto caps_error; + } alternate = GST_VIDEO_INFO_INTERLACE_MODE (&out_info) ==