[FFmpeg-devel] [PATCH] lavc/v4l2_m2m_dec: Init reserved bytes to zero before ioctl call

Andriy Gelman andriy.gelman at gmail.com
Fri Mar 13 04:40:42 EET 2020


On Sun, 08. Mar 11:49, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman at gmail.com>
> 
> 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 at gmail.com>
> ---
>  libavcodec/v4l2_m2m_dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
> index d666edffe46..c5ee86b9935 100644
> --- a/libavcodec/v4l2_m2m_dec.c
> +++ b/libavcodec/v4l2_m2m_dec.c
> @@ -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 */
> -- 
> 2.25.0
> 

ping

-- 
Andriy


More information about the ffmpeg-devel mailing list