Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-09 17:08:14 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 18:49:03 +0300
commit3078fc9de74fcb4845125621fb32f3495790cb48 (patch)
treeb05a8d1cba401d7d54b993c42ebbe4c7106f363b
parent5d7b87af7e26a961bc345329c4bb5ba39fd88d8b (diff)
avcodec/snowdec: Check width
Fixes: out of array read Fixes: 1419/clusterfuzz-testcase-minimized-6108700873850880 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 78aa93807b3e0674e34d32c0bf6f78d7f5b7927e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/snowdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 97f55288c1..022e9693c7 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -384,6 +384,10 @@ static int decode_header(SnowContext *s){
av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_count %d too large for size\n", s->spatial_decomposition_count);
return AVERROR_INVALIDDATA;
}
+ if (s->avctx->width > 65536-4) {
+ av_log(s->avctx, AV_LOG_ERROR, "Width %d is too large\n", s->avctx->width);
+ return AVERROR_INVALIDDATA;
+ }
s->qlog += get_symbol(&s->c, s->header_state, 1);