lavd/v4l2: Avoid setting frame_size to a negative value.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 10 Dec 2016 15:43:00 +0000 (16:43 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 24 Jan 2017 23:54:10 +0000 (00:54 +0100)
libavdevice/v4l2.c

index ae51d83..b57909b 100644 (file)
@@ -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);