diff mbox

[FFmpeg-devel,3/3] vaapi_encode_vp8: memset the the structure to 0

Message ID 20180504144107.16201-3-haihao.xiang@intel.com
State Accepted
Commit 1b0e0578c2ed1bf63e7c014906e02d654f286c0c
Headers show

Commit Message

Xiang, Haihao May 4, 2018, 2:41 p.m. UTC
The structure has reserved bytes, it is required to set the reserved
bytes to 0 for future use.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavcodec/vaapi_encode_vp8.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Thompson May 7, 2018, 8:48 p.m. UTC | #1
On 04/05/18 15:41, Haihao Xiang wrote:
> The structure has reserved bytes, it is required to set the reserved
> bytes to 0 for future use.
> 
> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> ---
>  libavcodec/vaapi_encode_vp8.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c
> index b4c5521d1f..a2e861a8d1 100644
> --- a/libavcodec/vaapi_encode_vp8.c
> +++ b/libavcodec/vaapi_encode_vp8.c
> @@ -143,6 +143,8 @@ static int vaapi_encode_vp8_write_quant_table(AVCodecContext *avctx,
>      *type     = VAQMatrixBufferType;
>      *data_len = sizeof(quant);
>  
> +    memset(&quant, 0, sizeof(quant));
> +
>      if (pic->type == PICTURE_TYPE_P)
>          q = priv->q_index_p;
>      else
> 

Yep, applied.

(... is there any plan to add anything to that structure?)

Thanks,

- Mark
Xiang, Haihao May 8, 2018, 2:56 a.m. UTC | #2
On Mon, 2018-05-07 at 21:48 +0100, Mark Thompson wrote:
> On 04/05/18 15:41, Haihao Xiang wrote:

> > The structure has reserved bytes, it is required to set the reserved

> > bytes to 0 for future use.

> > 

> > Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>

> > ---

> >  libavcodec/vaapi_encode_vp8.c | 2 ++

> >  1 file changed, 2 insertions(+)

> > 

> > diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c

> > index b4c5521d1f..a2e861a8d1 100644

> > --- a/libavcodec/vaapi_encode_vp8.c

> > +++ b/libavcodec/vaapi_encode_vp8.c

> > @@ -143,6 +143,8 @@ static int

> > vaapi_encode_vp8_write_quant_table(AVCodecContext *avctx,

> >      *type     = VAQMatrixBufferType;

> >      *data_len = sizeof(quant);

> >  

> > +    memset(&quant, 0, sizeof(quant));

> > +

> >      if (pic->type == PICTURE_TYPE_P)

> >          q = priv->q_index_p;

> >      else

> > 

> 

> Yep, applied.

> 

> (... is there any plan to add anything to that structure?)

> 


Thanks for applying the patch and so far there is no plan to change that
structure. 


> Thanks,

> 

> - Mark

> _______________________________________________

> ffmpeg-devel mailing list

> ffmpeg-devel@ffmpeg.org

> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
diff mbox

Patch

diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c
index b4c5521d1f..a2e861a8d1 100644
--- a/libavcodec/vaapi_encode_vp8.c
+++ b/libavcodec/vaapi_encode_vp8.c
@@ -143,6 +143,8 @@  static int vaapi_encode_vp8_write_quant_table(AVCodecContext *avctx,
     *type     = VAQMatrixBufferType;
     *data_len = sizeof(quant);
 
+    memset(&quant, 0, sizeof(quant));
+
     if (pic->type == PICTURE_TYPE_P)
         q = priv->q_index_p;
     else