From b01dba14f36aa3ff3d6fe89acf71eddbd65e7027 Mon Sep 17 00:00:00 2001 From: Luca Abeni Date: Wed, 28 Apr 2010 08:02:52 +0000 Subject: =?UTF-8?q?Check=20the=20return=20value=20of=20device=5Ftry=5Finit?= =?UTF-8?q?()=20immediately=20after=20calling=20such=20a=20function.=20Avo?= =?UTF-8?q?ids=20the=20following=20warning:=20libavdevice/v4l2.c:=20In=20f?= =?UTF-8?q?unction=20=E2=80=98v4l2=5Fread=5Fheader=E2=80=99:=20libavdevice?= =?UTF-8?q?/v4l2.c:586:=20warning:=20=E2=80=98codec=5Fid=E2=80=99=20may=20?= =?UTF-8?q?be=20used=20uninitialized=20in=20this=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 22986 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavdevice/v4l2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libavdevice') diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 724c014ecf..c8854c05c5 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -616,9 +616,6 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) } desired_format = device_try_init(s1, ap, &s->width, &s->height, &codec_id); - if (avcodec_check_dimensions(s1, s->width, s->height) < 0) - return AVERROR(EINVAL); - if (desired_format == 0) { av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for " "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, ap->pix_fmt); @@ -626,6 +623,8 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) return AVERROR(EIO); } + if (avcodec_check_dimensions(s1, s->width, s->height) < 0) + return AVERROR(EINVAL); s->frame_format = desired_format; if( v4l2_set_parameters( s1, ap ) < 0 ) -- cgit v1.2.3