diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 446a243cf8..365bacd771 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -811,7 +811,8 @@ static int device_try_init(AVFormatContext *ctx, } *codec_id = ff_fmt_v4l2codec(*desired_format); - av_assert0(*codec_id != AV_CODEC_ID_NONE); + if (*codec_id == AV_CODEC_ID_NONE) + av_assert0(ret == AVERROR(EINVAL)); return ret; }