ffmpeg | branch: master | Linjie Fu <linjie...@intel.com> | Mon Apr 15 21:23:18 
2019 +0800| [8f6e65183354d1d402ae80c71cba2759fe152018] | committer: Zhong Li

lavc/qsvenc: Fix the memory leak for enc_ctrl.Payload

frame->enc_ctrl.Payload is malloced in get_free_frame, directly memset
the whole structure of enc_ctrl to zero will cause the memory leak for
enc_ctrl.Payload.

frame->enc_ctrl as a structure will be malloc and init to zero by calling
frame = av_mallocz(sizeof(*frame)), so the memset is redundant and can
be removed.

Signed-off-by: Linjie Fu <linjie...@intel.com>
Signed-off-by: Zhong Li <zhong...@intel.com>

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

 libavcodec/qsvenc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index a03ab69590..8dbad713d0 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1307,7 +1307,6 @@ static int encode_frame(AVCodecContext *avctx, 
QSVEncContext *q,
     if (qsv_frame) {
         surf = &qsv_frame->surface;
         enc_ctrl = &qsv_frame->enc_ctrl;
-        memset(enc_ctrl, 0, sizeof(mfxEncodeCtrl));
 
         if (frame->pict_type == AV_PICTURE_TYPE_I) {
             enc_ctrl->FrameType = MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to