[FFmpeg-cvslog] avcodec/atrac1: Cleanup generically after init failure

Andreas Rheinhardt git at videolan.org
Tue Sep 15 20:43:37 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Sep 13 20:54:18 2020 +0200| [b0a29d88c83facec70f2a0a8941733f88ddde416] | committer: Andreas Rheinhardt

avcodec/atrac1: Cleanup generically after init failure

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b0a29d88c83facec70f2a0a8941733f88ddde416
---

 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,
 };



More information about the ffmpeg-cvslog mailing list