[FFmpeg-cvslog] avcodec/snowdec: Check for remaining bitstream in decode_blocks()

Michael Niedermayer git at videolan.org
Tue Jan 9 02:27:43 EET 2018


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Wed Nov 15 21:17:16 2017 +0100| [b24b316e304567719aa195ee97b010ccf4057f91] | committer: Michael Niedermayer

avcodec/snowdec: Check for remaining bitstream in decode_blocks()

Fixes: Timeout
Fixes: 3142/clusterfuzz-testcase-5007853163118592

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 4527ec2216109867498edc3ac8a17fd879b5d017)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/snowdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index af92cb0070..df425b8cf3 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -437,6 +437,8 @@ static int decode_blocks(SnowContext *s){
 
     for(y=0; y<h; y++){
         for(x=0; x<w; x++){
+            if (s->c.bytestream >= s->c.bytestream_end)
+                return AVERROR_INVALIDDATA;
             if ((res = decode_q_branch(s, 0, x, y)) < 0)
                 return res;
         }



More information about the ffmpeg-cvslog mailing list