mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 13:10:37 +00:00
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>
This commit is contained in:
parent
82ccb9cba9
commit
8f6e651833
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user