From 9d5141d1fb4c95600f9ca70a3db5475d1a78667b Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 10 Dec 2016 16:43:00 +0100 Subject: [PATCH] lavd/v4l2: Avoid setting frame_size to a negative value. --- libavdevice/v4l2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index ae51d837af..b57909bda6 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -936,6 +936,7 @@ static int v4l2_read_header(AVFormatContext *ctx) goto fail; st->codecpar->format = ff_fmt_v4l2ff(desired_format, codec_id); + if (st->codecpar->format != AV_PIX_FMT_NONE) s->frame_size = av_image_get_buffer_size(st->codecpar->format, s->width, s->height, 1);