v4l2object: Avoid crash on early failure

This happens while an external error lead to an early shutdown.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1567>
This commit is contained in:
Nicolas Dufresne 2022-01-26 09:55:09 -05:00 committed by GStreamer Marge Bot
parent ec9585d148
commit d394b8b4bd

View file

@ -3078,7 +3078,8 @@ gst_v4l2_object_is_dmabuf_supported (GstV4l2Object * v4l2object)
.flags = O_CLOEXEC | O_RDWR,
};
if (v4l2object->fmtdesc->flags & V4L2_FMT_FLAG_EMULATED) {
if (v4l2object->fmtdesc &&
v4l2object->fmtdesc->flags & V4L2_FMT_FLAG_EMULATED) {
GST_WARNING_OBJECT (v4l2object->dbg_obj,
"libv4l2 converter detected, disabling DMABuf");
ret = FALSE;