aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-08-04 23:45:52 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-11-01 00:52:46 +0100
commit907699d1207f50f3a0f9c96443ffbde71bb580e5 (patch)
tree869924cc5467e2a76f8d7f1ea27ab1dc17845c9a
parent298ca73ab14ba66fec0596fef1eda92a532a488d (diff)
downloadffmpeg-907699d1207f50f3a0f9c96443ffbde71bb580e5.tar.gz
avcodec/scpr: Check for min > max in decompress_p()
Fixes: Timeout Fixes: 9342/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-4795990841229312 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 3378194ce8e9a126a7cc6ed57bedde1221790469) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/scpr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index 694450abf0..f286ca8575 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -522,6 +522,9 @@ static int decompress_p(AVCodecContext *avctx,
return ret;
max += temp << 8;
+ if (min > max)
+ return AVERROR_INVALIDDATA;
+
memset(s->blocks, 0, sizeof(*s->blocks) * s->nbcount);
while (min <= max) {