mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1333>
This commit is contained in:
parent
7ab51e85ab
commit
969e647925
1 changed files with 7 additions and 1 deletions
|
@ -427,8 +427,14 @@ gst_interlace_setcaps (GstInterlace * interlace, GstCaps * caps)
|
||||||
src_peer_caps = gst_pad_peer_query_caps (interlace->srcpad, othercaps);
|
src_peer_caps = gst_pad_peer_query_caps (interlace->srcpad, othercaps);
|
||||||
gst_caps_unref (othercaps);
|
gst_caps_unref (othercaps);
|
||||||
othercaps = gst_caps_fixate (src_peer_caps);
|
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;
|
goto caps_error;
|
||||||
|
}
|
||||||
|
if (!gst_video_info_from_caps (&out_info, othercaps)) {
|
||||||
|
gst_caps_unref (othercaps);
|
||||||
|
goto caps_error;
|
||||||
|
}
|
||||||
|
|
||||||
alternate =
|
alternate =
|
||||||
GST_VIDEO_INFO_INTERLACE_MODE (&out_info) ==
|
GST_VIDEO_INFO_INTERLACE_MODE (&out_info) ==
|
||||||
|
|
Loading…
Reference in a new issue