[FFmpeg-devel] [PATCH 2/5] avcodec/aliaspixdec: Check input size against minimal picture size
Michael Niedermayer
michael at niedermayer.cc
Tue Oct 1 02:12:51 EEST 2019
Fixes: Timeout (15sec -> 72ms)
Fixes: 17774/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALIAS_PIX_fuzzer-5193929107963904
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/aliaspixdec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/aliaspixdec.c b/libavcodec/aliaspixdec.c
index 087b18fb91..def7e17c0f 100644
--- a/libavcodec/aliaspixdec.c
+++ b/libavcodec/aliaspixdec.c
@@ -62,6 +62,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (ret < 0)
return ret;
+ if (bytestream2_get_bytes_left(&gb) < width*height / 255)
+ return AVERROR_INVALIDDATA;
+
ret = ff_get_buffer(avctx, f, 0);
if (ret < 0)
return ret;
--
2.23.0
More information about the ffmpeg-devel
mailing list