aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/scpr.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-08-04 23:45:52 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-08-16 01:06:17 +0200
commit3378194ce8e9a126a7cc6ed57bedde1221790469 (patch)
tree8c613759f5746ec6b6ee46b805c2f6c29a9dfea8 /libavcodec/scpr.c
parent9b604e96a51a1fca92bbabfe4f7ac53f0470ee41 (diff)
downloadffmpeg-3378194ce8e9a126a7cc6ed57bedde1221790469.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>
Diffstat (limited to 'libavcodec/scpr.c')
-rw-r--r--libavcodec/scpr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index 72f59d5917..d76148998b 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -526,6 +526,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) {