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

avcodec/flashsv2enc: 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-14 16:57:49 +02:00
parent 319dbcf440
commit 42ed9707b5

View File

@ -235,7 +235,6 @@ static av_cold int flashsv2_encode_init(AVCodecContext * avctx)
|| !s->current_frame || !s->key_frame || !s->key_blocks
|| !s->frame_blocks) {
av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
cleanup(s);
return AVERROR(ENOMEM);
}
@ -918,4 +917,5 @@ AVCodec ff_flashsv2_encoder = {
.encode2 = flashsv2_encode_frame,
.close = flashsv2_encode_end,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};