[FFmpeg-devel] [PATCH 2/2] avcodec/fic: Check input size against minimal frame size
Michael Niedermayer
michael at niedermayer.cc
Wed May 1 22:40:07 EEST 2019
Fixes: Timeout (22sec ->54ms)
Fixes: 14439/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5660988231122944
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/fic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 65d102b86b..540078eda1 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -356,7 +356,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices;
msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE;
- if (msize <= 0) {
+ if (msize <= ctx->aligned_width/8 * (ctx->aligned_height/8) / 8) {
av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n");
return AVERROR_INVALIDDATA;
}
--
2.21.0
More information about the ffmpeg-devel
mailing list