aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-06 01:08:54 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 12:20:15 +0200
commit2d3da218ce3f47316476317d2ac591f0f03f4e01 (patch)
treea97c6cffaf7310e1c5f4b05bf7c89a65e239a51e
parentcff78c4cc437c3962f6c4d130907d0b8256be8ab (diff)
downloadffmpeg-2d3da218ce3f47316476317d2ac591f0f03f4e01.tar.gz
avcodec/snowdec: Check qbias
Fixes: signed integer overflow: -1094995529 * 131 cannot be represented in type 'int' Fixes: 1353/clusterfuzz-testcase-minimized-5208180449607680 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 523205ce1ed9415183c162998c68f573479e78fe) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/snowdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 042aecbbeb..97f55288c1 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -395,6 +395,11 @@ static int decode_header(SnowContext *s){
s->block_max_depth= 0;
return AVERROR_INVALIDDATA;
}
+ if (FFABS(s->qbias) > 127) {
+ av_log(s->avctx, AV_LOG_ERROR, "qbias %d is too large\n", s->qbias);
+ s->qbias = 0;
+ return AVERROR_INVALIDDATA;
+ }
return 0;
}