aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinjie Fu2019-04-15 21:23:18 +0800
committerZhong Li2019-05-22 22:16:21 +0800
commit8f6e65183354d1d402ae80c71cba2759fe152018 (patch)
tree6dca5cbef2b5186f08ecc24716cc2b1574987bf6
parent82ccb9cba9a7bd530ba2070c90f03d0fde9af1bd (diff)
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>
-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;