aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qsvenc.c
diff options
context:
space:
mode:
authorLinjie Fu <linjie.fu@intel.com>2019-04-15 21:23:18 +0800
committerZhong Li <zhong.li@intel.com>2019-05-22 22:16:21 +0800
commit8f6e65183354d1d402ae80c71cba2759fe152018 (patch)
tree6dca5cbef2b5186f08ecc24716cc2b1574987bf6 /libavcodec/qsvenc.c
parent82ccb9cba9a7bd530ba2070c90f03d0fde9af1bd (diff)
downloadffmpeg-8f6e65183354d1d402ae80c71cba2759fe152018.tar.gz
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.fu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r--libavcodec/qsvenc.c1
1 files changed, 0 insertions, 1 deletions
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;