diff mbox series

[FFmpeg-devel,2/6] avcodec/qsvenc: Fix leak of A53 data

Message ID AM7PR03MB66608C45F7585A151884244C8FA69@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit e9e2157dda26a08113a146330682f29e6d2accb4
Headers show
Series [FFmpeg-devel,1/6] avcodec/qsvenc: Fix leak and crash when encoding H.264 due to A53_CC | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 26, 2021, 6:40 a.m. UTC
Up until now, it has only been freed when the QSVFrame is reused,
so that the last one contained in it leaked at the end.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/qsvenc.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 66f79bb021..e5d09752cb 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1612,6 +1612,7 @@  int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q)
     while (cur) {
         q->work_frames = cur->next;
         av_frame_free(&cur->frame);
+        free_encoder_ctrl_payloads(&cur->enc_ctrl);
         av_freep(&cur);
         cur = q->work_frames;
     }