mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/mimic: Cleanup generically upon init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
e9d06fef62
commit
3066b243e9
|
@ -155,11 +155,9 @@ static av_cold int mimic_decode_init(AVCodecContext *avctx)
|
||||||
|
|
||||||
for (i = 0; i < FF_ARRAY_ELEMS(ctx->frames); i++) {
|
for (i = 0; i < FF_ARRAY_ELEMS(ctx->frames); i++) {
|
||||||
ctx->frames[i].f = av_frame_alloc();
|
ctx->frames[i].f = av_frame_alloc();
|
||||||
if (!ctx->frames[i].f) {
|
if (!ctx->frames[i].f)
|
||||||
mimic_decode_end(avctx);
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -460,5 +458,5 @@ AVCodec ff_mimic_decoder = {
|
||||||
.decode = mimic_decode_frame,
|
.decode = mimic_decode_frame,
|
||||||
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
|
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
|
||||||
.update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context),
|
.update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context),
|
||||||
.caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS,
|
.caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue