diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-08-05 00:45:52 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-08-16 02:06:17 +0300 |
commit | 3378194ce8e9a126a7cc6ed57bedde1221790469 (patch) | |
tree | 8c613759f5746ec6b6ee46b805c2f6c29a9dfea8 /libavcodec/scpr.c | |
parent | 9b604e96a51a1fca92bbabfe4f7ac53f0470ee41 (diff) |
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.c | 3 |
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) { |