1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/dxa: Cleanup generically after init failure

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-09-14 02:31:46 +02:00
parent 2fd3ada931
commit 6d80189486

View File

@ -343,7 +343,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->dsize = avctx->width * avctx->height * 2; c->dsize = avctx->width * avctx->height * 2;
c->decomp_buf = av_malloc(c->dsize + DECOMP_BUF_PADDING); c->decomp_buf = av_malloc(c->dsize + DECOMP_BUF_PADDING);
if (!c->decomp_buf) { if (!c->decomp_buf) {
av_frame_free(&c->prev);
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n"); av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
@ -371,4 +370,5 @@ AVCodec ff_dxa_decoder = {
.close = decode_end, .close = decode_end,
.decode = decode_frame, .decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1, .capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}; };