Commit 8de4a132 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avcodec/c93: Cleanup generically after init failure

Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 142ae27b
......@@ -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,
};
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