diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-09 04:17:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-04-13 00:35:15 +0200 |
commit | 0df3ad79c7d8d8740693deedccf82e7c28bb60b6 (patch) | |
tree | e13356e36159ce09c2f70d1817443e8018f49a01 /libavcodec | |
parent | 65fc03589fb48ee1d24797ad3984199b01feec82 (diff) | |
download | ffmpeg-0df3ad79c7d8d8740693deedccf82e7c28bb60b6.tar.gz |
avcodec/vp3: Check eob_run
Fixes: out of array access
Fixes: 5919/clusterfuzz-testcase-minimized-5859311382167552
Fixes: special case for theora (untested due to lack of sample)
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 570023eab3e2962b4ad8345a157c1e18ca1a6eca)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vp3.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index b10cb39f8a..e46a9e6971 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -978,6 +978,9 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, if (eob_run_get_bits[token]) eob_run += get_bits(gb, eob_run_get_bits[token]); + if (!eob_run) + eob_run = INT_MAX; + // record only the number of blocks ended in this plane, // any spill will be recorded in the next plane. if (eob_run > num_coeffs - coeff_i) { |