summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-12-10 16:43:00 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2017-01-25 00:54:10 +0100
commit9d5141d1fb4c95600f9ca70a3db5475d1a78667b (patch)
tree792fc38e188ed4a76824ef0ddb876030117f8470 /libavdevice
parent75bd4ea02400ffa5fa95569a9cf3213c64e651fb (diff)
lavd/v4l2: Avoid setting frame_size to a negative value.
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/v4l2.c1
1 files changed, 1 insertions, 0 deletions
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);