diff options
author | Alex Converse <alex.converse@gmail.com> | 2011-11-03 15:55:52 -0700 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2011-11-03 16:40:34 -0700 |
commit | 2a6eb06254df79e96b3d791b6b89b2534ced3119 (patch) | |
tree | 794f3e7729f85eb2f2f10fe29c53d201b3ac72c0 | |
parent | 0d7a16a9467eab58aca4508a70cb546741664ac0 (diff) | |
download | ffmpeg-2a6eb06254df79e96b3d791b6b89b2534ced3119.tar.gz |
vp6: Fix illegal read.
-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 e29f9014aa..03024fa865 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -376,7 +376,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]--; @@ -413,6 +413,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]; } |