diff mbox series

[FFmpeg-devel,3/4] avcodec/imc: Fix leak on init error

Message ID AS8P250MB074437D9C48129EC45649A7B8FF2A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit eb9bfe30a284810817f8549ce798cfac57eb694f
Headers show
Series [FFmpeg-devel,1/4] avcodec/libaribb24, ttmlenc, avutil/tx: Remove redundant init of AVBPrint | expand

Checks

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

Commit Message

Andreas Rheinhardt Sept. 11, 2023, 3:31 p.m. UTC
Since e6afa61be97674312e36c9b6f8bb5fba009232e7 an AVFloatDSPContext
would leak on av_tx_init() failure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/imc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paul B Mahol Sept. 11, 2023, 5:10 p.m. UTC | #1
LGTM
diff mbox series

Patch

diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 83572c4f2c..754ceff958 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -1038,6 +1038,7 @@  const FFCodec ff_imc_decoder = {
     .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
     .p.sample_fmts  = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
                                                       AV_SAMPLE_FMT_NONE },
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };
 #endif
 #if CONFIG_IAC_DECODER
@@ -1054,5 +1055,6 @@  const FFCodec ff_iac_decoder = {
     .p.capabilities = AV_CODEC_CAP_DR1,
     .p.sample_fmts  = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
                                                       AV_SAMPLE_FMT_NONE },
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };
 #endif