[FFmpeg-cvslog] vaapi_encode: Do not zero access unit structures

Mark Thompson git at videolan.org
Tue Feb 26 01:31:08 EET 2019


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Mon Feb 25 23:24:23 2019 +0000| [9d5ca71ec2efddfa0d30ae88db66fd0bd3f1f33b] | committer: Mark Thompson

vaapi_encode: Do not zero access unit structures

Following b8c45bbcbc207293f955e838ea66106f4b65b1ac they contain allocated
unit arrays which will get leaked.  These operations were inconsistently
applied and never actually needed (the old uninit left them in the correct
state), so just drop them entirely.

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

 libavcodec/vaapi_encode_h264.c | 6 ------
 libavcodec/vaapi_encode_h265.c | 3 ---
 2 files changed, 9 deletions(-)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 9f984ec60d..0be29d5b05 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -299,9 +299,6 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
     VAEncSequenceParameterBufferH264 *vseq = ctx->codec_sequence_params;
     VAEncPictureParameterBufferH264  *vpic = ctx->codec_picture_params;
 
-    memset(&priv->current_access_unit, 0,
-           sizeof(priv->current_access_unit));
-
     memset(sps, 0, sizeof(*sps));
     memset(pps, 0, sizeof(*pps));
 
@@ -624,9 +621,6 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx,
     VAEncPictureParameterBufferH264 *vpic = pic->codec_picture_params;
     int i;
 
-    memset(&priv->current_access_unit, 0,
-           sizeof(priv->current_access_unit));
-
     if (pic->type == PICTURE_TYPE_IDR) {
         av_assert0(pic->display_order == pic->encode_order);
 
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 9e32cd285b..d37100c52d 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -270,9 +270,6 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx)
     int chroma_format, bit_depth;
     int i;
 
-    memset(&priv->current_access_unit, 0,
-           sizeof(priv->current_access_unit));
-
     memset(vps, 0, sizeof(*vps));
     memset(sps, 0, sizeof(*sps));
     memset(pps, 0, sizeof(*pps));



More information about the ffmpeg-cvslog mailing list