v4l2: object: Handle video helper return value

gst_video_info_set_interlaced_format() can return an error if the
width/height causes integer overflow. Handle this case, so that we can
fail cleanly. This has been experienced while testing an in-progress
driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5319>
This commit is contained in:
Nicolas Dufresne 2023-09-05 16:56:44 -04:00 committed by Tim-Philipp Müller
parent bce3053598
commit 92820a8cf2

View file

@ -4350,8 +4350,9 @@ gst_v4l2_object_acquire_format (GstV4l2Object * v4l2object, GstVideoInfo * info)
goto unsupported_field;
}
gst_video_info_set_interlaced_format (info, format, interlace_mode, width,
height);
if (!gst_video_info_set_interlaced_format (info, format, interlace_mode,
width, height))
goto invalid_dimensions;
gst_v4l2_object_get_colorspace (v4l2object, &fmt, &info->colorimetry);
gst_v4l2_object_get_streamparm (v4l2object, info);