[FFmpeg-devel] [PATCH 1/2] avcodec/hcadec: Fix memleak upon allocation error

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue Feb 8 17:40:16 EET 2022


An AVFloatDSPContext would leak upon av_tx_init() failure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/hcadec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c
index c98f8eb379..ef3af08c4c 100644
--- a/libavcodec/hcadec.c
+++ b/libavcodec/hcadec.c
@@ -455,6 +455,7 @@ const AVCodec ff_hca_decoder = {
     .decode         = decode_frame,
     .close          = decode_close,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
                                                       AV_SAMPLE_FMT_NONE },
 };
-- 
2.32.0



More information about the ffmpeg-devel mailing list