mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
v4l2: do not assert on a value received from outside of Libav
This commit is contained in:
parent
838b849e70
commit
49dc82eef7
@ -460,7 +460,12 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
|
|||||||
|
|
||||||
return AVERROR(errno);
|
return AVERROR(errno);
|
||||||
}
|
}
|
||||||
assert (buf.index < s->buffers);
|
|
||||||
|
if (buf.index >= s->buffers) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Invalid buffer index received.\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
if (s->frame_size > 0 && buf.bytesused != s->frame_size) {
|
if (s->frame_size > 0 && buf.bytesused != s->frame_size) {
|
||||||
av_log(ctx, AV_LOG_ERROR,
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
"The v4l2 frame is %d bytes, but %d bytes are expected\n",
|
"The v4l2 frame is %d bytes, but %d bytes are expected\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user