1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

libavcodec/qsvenc: fix a memory leak problem

"qf->frame" ref to input frame but it isn't released. av_frame_unref()
is added before refering qf->frame to new frame to make sure the previous
reference is released.

Reported-by: Mark Samuelson <Mark.Samuelson@sonicfoundry.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
This commit is contained in:
Wenbin Chen 2022-01-20 15:13:43 +08:00 committed by Haihao Xiang
parent 3d29724c00
commit 05ba0ffca9

View File

@ -1575,6 +1575,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
return ret;
}
} else {
av_frame_unref(qf->frame);
ret = av_frame_ref(qf->frame, frame);
if (ret < 0)
return ret;