Commit 7963014b23 for ffmpeg
commit 7963014b2301adef72881dc922a7b572ac6d28ca
Author: Martin Storsjö <martin@martin.st>
Date: Tue Sep 29 15:17:24 2026 +0300
libfdk-aacenc: Fix memory leaks on error on init
The close function isn't called automatically when the init function
returns an error, we need to goto the error cleanup at the end
of the function instead.
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 0a9ab7b5b7..072000923b 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -441,8 +441,10 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
}
cpb_props = ff_encode_add_cpb_side_data(avctx);
- if (!cpb_props)
- return AVERROR(ENOMEM);
+ if (!cpb_props) {
+ ret = AVERROR(ENOMEM);
+ goto error;
+ }
cpb_props->max_bitrate =
cpb_props->min_bitrate =
cpb_props->avg_bitrate = avctx->bit_rate;