diff mbox

[FFmpeg-devel] avcodec/vp3: Check eob_run

Message ID 20180209125639.21923-1-michael@niedermayer.cc
State Accepted
Commit 570023eab3e2962b4ad8345a157c1e18ca1a6eca
Headers show

Commit Message

Michael Niedermayer Feb. 9, 2018, 12:56 p.m. UTC
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>
---
 libavcodec/vp3.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Feb. 11, 2018, 1:40 a.m. UTC | #1
On Fri, Feb 09, 2018 at 01:56:39PM +0100, Michael Niedermayer wrote:
> 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>
> ---
>  libavcodec/vp3.c | 3 +++
>  1 file changed, 3 insertions(+)

applied

[...]
diff mbox

Patch

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index cf9c57f5fa..33be345c14 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) {