[FFmpeg-devel] [PATCH] libavcodec/qsvenc: fix a memory leak problem
Wenbin Chen
wenbin.chen at intel.com
Thu Jan 20 09:13:43 EET 2022
"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.
Signed-off-by: Wenbin Chen <wenbin.chen at intel.com>
---
libavcodec/qsvenc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 269386624d..fd5c460d68 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1521,6 +1521,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;
--
2.25.1
More information about the ffmpeg-devel
mailing list