Commit 76af4251 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/flashsv: add FF_CODEC_CAP_INIT_CLEANUP to flashsv1

Fixes: memleaks on error paths during init
Fixes: 15533/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLASHSV_fuzzer-5647977168764928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5c46fdf3
...@@ -132,7 +132,6 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx) ...@@ -132,7 +132,6 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx)
s->frame = av_frame_alloc(); s->frame = av_frame_alloc();
if (!s->frame) { if (!s->frame) {
flashsv_decode_end(avctx);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
...@@ -518,6 +517,7 @@ AVCodec ff_flashsv_decoder = { ...@@ -518,6 +517,7 @@ AVCodec ff_flashsv_decoder = {
.close = flashsv_decode_end, .close = flashsv_decode_end,
.decode = flashsv_decode_frame, .decode = flashsv_decode_frame,
.capabilities = AV_CODEC_CAP_DR1, .capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
}; };
#endif /* CONFIG_FLASHSV_DECODER */ #endif /* CONFIG_FLASHSV_DECODER */
......
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