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

avcodec/c93: Cleanup generically after init failure

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-09-13 22:42:26 +02:00
parent 142ae27b1d
commit 8de4a132ff

View File

@ -63,10 +63,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->pictures[0] = av_frame_alloc();
s->pictures[1] = av_frame_alloc();
if (!s->pictures[0] || !s->pictures[1]) {
decode_end(avctx);
if (!s->pictures[0] || !s->pictures[1])
return AVERROR(ENOMEM);
}
return 0;
}
@ -269,5 +267,5 @@ AVCodec ff_c93_decoder = {
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};