[FFmpeg-cvslog] r22986 - trunk/libavdevice/v4l2.c

lucabe subversion
Wed Apr 28 10:02:52 CEST 2010


Author: lucabe
Date: Wed Apr 28 10:02:52 2010
New Revision: 22986

Log:
Check the return value of device_try_init() immediately after calling such a
function. Avoids the following warning:
libavdevice/v4l2.c: In function ?v4l2_read_header?:
libavdevice/v4l2.c:586: warning: ?codec_id? may be used uninitialized in this function

Modified:
   trunk/libavdevice/v4l2.c

Modified: trunk/libavdevice/v4l2.c
==============================================================================
--- trunk/libavdevice/v4l2.c	Wed Apr 28 09:57:07 2010	(r22985)
+++ trunk/libavdevice/v4l2.c	Wed Apr 28 10:02:52 2010	(r22986)
@@ -616,9 +616,6 @@ static int v4l2_read_header(AVFormatCont
     }
 
     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(AVFormatCont
 
         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 )



More information about the ffmpeg-cvslog mailing list