]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/v4l2_m2m_dec: Init reserved bytes to zero before ioctl call
authorAndriy Gelman <andriy.gelman@gmail.com>
Sun, 8 Mar 2020 15:49:47 +0000 (11:49 -0400)
committerAndriy Gelman <andriy.gelman@gmail.com>
Wed, 1 Apr 2020 03:41:37 +0000 (23:41 -0400)
struct v4l2_selection contains reserved bytes which should be set to
zero before the ioctl call.

Fixes valgrind error:
Syscall param ioctl(VKI_V4L2_S_SELECTION) points to uninitialised byte(s)

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
libavcodec/v4l2_m2m_dec.c

index d666edffe460b0df5bf120f542960bd1ed296564..c5ee86b99358112078cdd0a5cce930d9aff7ac09 100644 (file)
@@ -39,7 +39,7 @@ static int v4l2_try_start(AVCodecContext *avctx)
     V4L2m2mContext *s = ((V4L2m2mPriv*)avctx->priv_data)->context;
     V4L2Context *const capture = &s->capture;
     V4L2Context *const output = &s->output;
-    struct v4l2_selection selection;
+    struct v4l2_selection selection = { 0 };
     int ret;
 
     /* 1. start the output process */