diff options
author | Wenbin Chen <wenbin.chen-at-intel.com@ffmpeg.org> | 2022-01-20 15:13:43 +0800 |
---|---|---|
committer | Haihao Xiang <haihao.xiang@intel.com> | 2022-01-24 10:18:11 +0800 |
commit | 05ba0ffca9b4c28e08fdd8086218c0075537125c (patch) | |
tree | 6e6b0d303d02bdb603ac801e26fe1021a54fe78a | |
parent | 3d29724c008d8f27fecf85757152789b074e8ef9 (diff) | |
download | ffmpeg-05ba0ffca9b4c28e08fdd8086218c0075537125c.tar.gz |
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>
-rw-r--r-- | libavcodec/qsvenc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 413e5ae8f6..acb82f321c 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -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; |