[FFmpeg-cvslog] avcodec/mss3: Check for the rac stream being invalid in rac_normalize()

Michael Niedermayer git at videolan.org
Mon Aug 5 20:50:19 EEST 2019


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Aug  4 09:33:45 2019 +0200| [8b8f5fd05e7e0c20b2fd12e8a4e9f2542eba7e3a] | committer: Michael Niedermayer

avcodec/mss3: Check for the rac stream being invalid in rac_normalize()

Fixes: out of array read
Fixes: 15982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSA1_fuzzer-5630676251967488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 99a172f3f4d0bef024c6293f575caaaddce0b267)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/mss3.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
index 21226f9085..02bd360996 100644
--- a/libavcodec/mss3.c
+++ b/libavcodec/mss3.c
@@ -298,6 +298,10 @@ static void rac_normalise(RangeCoder *c)
             c->got_error = 1;
             c->low = 1;
         }
+        if (c->low > c->range) {
+            c->got_error = 1;
+            c->low = 1;
+        }
         if (c->range >= RAC_BOTTOM)
             return;
     }



More information about the ffmpeg-cvslog mailing list