diff mbox

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

Message ID 20171115201716.2924-2-michael@niedermayer.cc
State Accepted
Commit 4527ec2216109867498edc3ac8a17fd879b5d017
Headers show

Commit Message

Michael Niedermayer Nov. 15, 2017, 8:17 p.m. UTC
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@niedermayer.cc>
---
 libavcodec/snowdec.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer Nov. 17, 2017, 5:43 p.m. UTC | #1
On Wed, Nov 15, 2017 at 09:17:16PM +0100, Michael Niedermayer wrote:
> 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@niedermayer.cc>
> ---
>  libavcodec/snowdec.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply


[...]
diff mbox

Patch

diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 77ffe7f594..99b5a86394 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -439,6 +439,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;
         }