aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-13 21:05:52 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-18 02:51:10 +0200
commitf9ff4b252f993add29e3b020e995b591ba1485e9 (patch)
tree75491fce6734ed11f6ba89e004790f8e3e4b8676
parent04101222f23fef3af57ac2cf1b8835f350fd4e50 (diff)
downloadffmpeg-f9ff4b252f993add29e3b020e995b591ba1485e9.tar.gz
avcodec/atrac3: Cleanup generically after init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavcodec/atrac3.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 067aa23f1f..ef2f8428dc 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -977,7 +977,6 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
/* initialize the MDCT transform */
if ((ret = ff_mdct_init(&q->mdct_ctx, 9, 1, 1.0 / 32768)) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n");
- av_freep(&q->decoded_bytes_buffer);
return ret;
}
@@ -1002,7 +1001,6 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
q->units = av_mallocz_array(avctx->channels, sizeof(*q->units));
if (!q->units || !q->fdsp) {
- atrac3_decode_close(avctx);
return AVERROR(ENOMEM);
}
@@ -1021,6 +1019,7 @@ AVCodec ff_atrac3_decoder = {
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
AVCodec ff_atrac3al_decoder = {
@@ -1035,4 +1034,5 @@ AVCodec ff_atrac3al_decoder = {
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};