diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-09 16:08:14 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-20 03:41:34 +0200 |
commit | eca9c51090b28f9cc2c08b4c6c0678c32b4fbb03 (patch) | |
tree | 5cec629760af2a2982899edc7a3570cdf849137b /libavcodec | |
parent | ef94fb391ff6d14ebd03ce428405a9e1915bfc0a (diff) | |
download | ffmpeg-eca9c51090b28f9cc2c08b4c6c0678c32b4fbb03.tar.gz |
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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/snowdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index c18ba38e7b..e5051c4ff7 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -381,6 +381,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); |