aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/atrac1.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-13 20:54:18 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-15 19:25:25 +0200
commitb0a29d88c83facec70f2a0a8941733f88ddde416 (patch)
treec9e44bfe6c89f91b15d7ad086f2daab424d0b05b /libavcodec/atrac1.c
parente75ccc81234a22eee90e2a31808639e754b97cd1 (diff)
downloadffmpeg-b0a29d88c83facec70f2a0a8941733f88ddde416.tar.gz
avcodec/atrac1: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/atrac1.c')
-rw-r--r--libavcodec/atrac1.c3
1 files changed, 1 insertions, 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,
};