Commit e49338a9 authored by James Almer's avatar James Almer

avcodec/audiotoolboxdec: add FF_CODEC_CAP_INIT_CLEANUP to the decoder capabilities

Extradata may be allocated and the AudioConverterRef may be created during init(),
which in case of a failure would not be freed as close() isn't called afterwards.
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 7273e234
......@@ -599,6 +599,7 @@ static av_cold void ffat_decode_flush(AVCodecContext *avctx)
static av_cold int ffat_close_decoder(AVCodecContext *avctx)
{
ATDecodeContext *at = avctx->priv_data;
if (at->converter)
AudioConverterDispose(at->converter);
av_bsf_free(&at->bsf);
av_packet_unref(&at->new_in_pkt);
......@@ -628,7 +629,7 @@ static av_cold int ffat_close_decoder(AVCodecContext *avctx)
.flush = ffat_decode_flush, \
.priv_class = &ffat_##NAME##_dec_class, \
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, \
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, \
};
FFAT_DEC(aac, AV_CODEC_ID_AAC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment