summaryrefslogtreecommitdiff
path: root/libavcodec/snowdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-11-15 21:17:16 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-11-17 20:37:41 +0100
commit4527ec2216109867498edc3ac8a17fd879b5d017 (patch)
treee9d2822dd67c914d8d71c4097544cb7712982e83 /libavcodec/snowdec.c
parentc3b9bbcc6edf2d83fe4857484cfa0839872188c6 (diff)
downloadffmpeg-4527ec2216109867498edc3ac8a17fd879b5d017.tar.gz
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@niedermayer.cc>
Diffstat (limited to 'libavcodec/snowdec.c')
-rw-r--r--libavcodec/snowdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index a828769610..a9bdb8da5e 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;
}