diff options
author | Alex Converse <alex.converse@gmail.com> | 2011-11-03 15:55:52 -0700 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-12-04 09:20:49 +0100 |
commit | 67a7ed623b678a84c992dd7bf3e3d0329f83621b (patch) | |
tree | a15e59f244969037753fbade58edc7831a2cee00 /libavcodec | |
parent | c76505e0dee0890e39636ddebd2707ab3ea5b8de (diff) | |
download | ffmpeg-67a7ed623b678a84c992dd7bf3e3d0329f83621b.tar.gz |
vp6: Fix illegal read.
(cherry picked from commit 2a6eb06254df79e96b3d791b6b89b2534ced3119)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vp6.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 48d7e7bf5b..ecfc81f048 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -374,7 +374,7 @@ static void vp6_parse_coeff_huffman(VP56Context *s) if (b > 3) pt = 1; vlc_coeff = &s->dccv_vlc[pt]; - for (coeff_idx=0; coeff_idx<64; ) { + for (coeff_idx = 0;;) { int run = 1; if (coeff_idx<2 && s->nb_null[coeff_idx][pt]) { s->nb_null[coeff_idx][pt]--; @@ -411,6 +411,8 @@ static void vp6_parse_coeff_huffman(VP56Context *s) } } coeff_idx+=run; + if (coeff_idx >= 64) + break; cg = FFMIN(vp6_coeff_groups[coeff_idx], 3); vlc_coeff = &s->ract_vlc[pt][ct][cg]; } |