avcodec/tta: Cleanup generically on init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
7743933a60
commit
f200424fbf
@ -114,10 +114,8 @@ static int allocate_buffers(AVCodecContext *avctx)
|
|||||||
} else
|
} else
|
||||||
s->decode_buffer = NULL;
|
s->decode_buffer = NULL;
|
||||||
s->ch_ctx = av_malloc_array(avctx->channels, sizeof(*s->ch_ctx));
|
s->ch_ctx = av_malloc_array(avctx->channels, sizeof(*s->ch_ctx));
|
||||||
if (!s->ch_ctx) {
|
if (!s->ch_ctx)
|
||||||
av_freep(&s->decode_buffer);
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -426,5 +424,5 @@ const AVCodec ff_tta_decoder = {
|
|||||||
.decode = tta_decode_frame,
|
.decode = tta_decode_frame,
|
||||||
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF,
|
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF,
|
||||||
.priv_class = &tta_decoder_class,
|
.priv_class = &tta_decoder_class,
|
||||||
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
|
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user