aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-01 00:06:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:48 +0100
commit188204da6cb503ec7de1ca80e7162bf8abf616aa (patch)
tree56ae69f7c83825b3aa4c740d2f550c8ca4cc1466
parentd999bbe7984e2b3f98f54f3d2f0d36c6fe889a0d (diff)
downloadffmpeg-188204da6cb503ec7de1ca80e7162bf8abf616aa.tar.gz
avcodec/aliaspixdec: Check input size against minimal picture size
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@niedermayer.cc> (cherry picked from commit 8c693104779830028bd5f76bf32a93e059c04d2c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/aliaspixdec.c3
1 files changed, 3 insertions, 0 deletions
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;