[FFmpeg-devel] [PATCH 20/40] avcodec/atrac1: Cleanup generically after init failure
Andreas Rheinhardt
andreas.rheinhardt at gmail.com
Mon Sep 14 08:27:27 EEST 2020
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
libavcodec/atrac1.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
index 9ecd49273d..4cfb1061c5 100644
--- a/libavcodec/atrac1.c
+++ b/libavcodec/atrac1.c
@@ -353,7 +353,6 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
(ret = ff_mdct_init(&q->mdct_ctx[1], 8, 1, -1.0/ (1 << 15))) ||
(ret = ff_mdct_init(&q->mdct_ctx[2], 9, 1, -1.0/ (1 << 15)))) {
av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n");
- atrac1_decode_end(avctx);
return ret;
}
@@ -363,7 +362,6 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
q->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!q->fdsp) {
- atrac1_decode_end(avctx);
return AVERROR(ENOMEM);
}
@@ -393,4 +391,5 @@ AVCodec ff_atrac1_decoder = {
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
--
2.25.1
More information about the ffmpeg-devel
mailing list