diff mbox series

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

Message ID 20200308154947.25191-1-andriy.gelman@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel] lavc/v4l2_m2m_dec: Init reserved bytes to zero before ioctl call
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andriy Gelman March 8, 2020, 3:49 p.m. UTC
From: Andriy Gelman <andriy.gelman@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@gmail.com>
---
 libavcodec/v4l2_m2m_dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andriy Gelman March 13, 2020, 2:40 a.m. UTC | #1
On Sun, 08. Mar 11:49, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman@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@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 Gelman March 27, 2020, 1:16 a.m. UTC | #2
On Thu, 12. Mar 22:40, Andriy Gelman wrote:
> On Sun, 08. Mar 11:49, Andriy Gelman wrote:
> > From: Andriy Gelman <andriy.gelman@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@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
> 

ping
Michael Niedermayer March 31, 2020, 10:38 p.m. UTC | #3
On Sun, Mar 08, 2020 at 11:49:47AM -0400, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman@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@gmail.com>
> ---
>  libavcodec/v4l2_m2m_dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

probably ok

thx

[...]
Andriy Gelman April 1, 2020, 3:47 a.m. UTC | #4
On Wed, 01. Apr 00:38, Michael Niedermayer wrote:
> On Sun, Mar 08, 2020 at 11:49:47AM -0400, Andriy Gelman wrote:
> > From: Andriy Gelman <andriy.gelman@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@gmail.com>
> > ---
> >  libavcodec/v4l2_m2m_dec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> probably ok
> 
> thx
> 

Applied.

Thanks,
diff mbox series

Patch

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 */