[FFmpeg-cvslog] avcodec/scpr: Check for min > max in decompress_p()

Michael Niedermayer git at videolan.org
Thu Aug 16 04:07:03 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Aug  4 23:45:52 2018 +0200| [3378194ce8e9a126a7cc6ed57bedde1221790469] | committer: Michael Niedermayer

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3378194ce8e9a126a7cc6ed57bedde1221790469
---

 libavcodec/scpr.c | 3 +++
 1 file changed, 3 insertions(+)

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) {



More information about the ffmpeg-cvslog mailing list