aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-11-15 21:17:16 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-01-31 22:56:14 +0100
commit20d6a6fa5aceb2895743d780be7a13eea52d343b (patch)
tree4af8d6ffdfd16488179b2b2cd37707c2c4bf5179
parent7d6319e5e65825402bf666217288b49d5e25e40f (diff)
downloadffmpeg-20d6a6fa5aceb2895743d780be7a13eea52d343b.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> (cherry picked from commit 4527ec2216109867498edc3ac8a17fd879b5d017) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/snowdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index f95f538f6c..4506c9b815 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -434,6 +434,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;
}