[FFmpeg-cvslog] lavd/v4l2: fully init an ioctl argument.

Nicolas George git at videolan.org
Mon Apr 1 15:19:30 CEST 2013


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed Mar 27 11:11:31 2013 +0100| [9dd54d74226eaaa1087ba994ba212bf9a107c97d] | committer: Nicolas George

lavd/v4l2: fully init an ioctl argument.

Silence a valgrind warning about uninitialized memory.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9dd54d74226eaaa1087ba994ba212bf9a107c97d
---

 libavdevice/v4l2.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 284b495..34e3d9c 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -949,11 +949,10 @@ static int v4l2_read_header(AVFormatContext *s1)
     }
 
     if (!s->width && !s->height) {
-        struct v4l2_format fmt;
+        struct v4l2_format fmt = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
 
         av_log(s1, AV_LOG_VERBOSE,
                "Querying the device for the current frame size\n");
-        fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
         if (v4l2_ioctl(s->fd, VIDIOC_G_FMT, &fmt) < 0) {
             res = AVERROR(errno);
             av_log(s1, AV_LOG_ERROR, "ioctl(VIDIOC_G_FMT): %s\n", av_err2str(res));



More information about the ffmpeg-cvslog mailing list