diff options
author | Alex Converse <alex.converse@gmail.com> | 2011-11-04 02:55:52 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-04 04:54:13 +0400 |
commit | 93f1159af5221e23c749be8fa0d3df3ef7a93fd0 (patch) | |
tree | 9b180b8d7f65cd4865812f184668bb59dab97c12 /libavcodec | |
parent | b08001e00ac4be3dd586825d135b30bdf389d7b0 (diff) |
vp6: Fix illegal read.
(cherry picked from commit 2a6eb06254df79e96b3d791b6b89b2534ced3119)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 3721d52192..c66d2e74ff 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]; } |