summaryrefslogtreecommitdiff
path: root/libavcodec/vp5.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-18 02:55:19 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-18 02:55:32 +0100
commit95d6e5bdd58d5caaa52c57bad1e1d87df59fb7f8 (patch)
tree2fc396cb5bebf8ea0f2f46ea55993f902a7ec5b2 /libavcodec/vp5.c
parent640424e080cbff3733706321d05c32eb7c87b90b (diff)
parentbb4b0ad83b13c3af57675e80163f3f333adef96f (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: vp5: Fix illegal read. vp6: Fix illegal read. tls: Use TLSv1_client_method for OpenSSL Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vp5.c')
-rw-r--r--libavcodec/vp5.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c
index 50bd868b51..23d0acc631 100644
--- a/libavcodec/vp5.c
+++ b/libavcodec/vp5.c
@@ -185,7 +185,8 @@ static void vp5_parse_coeff(VP56Context *s)
model1 = model->coeff_dccv[pt];
model2 = model->coeff_dcct[pt][ctx];
- for (coeff_idx=0; coeff_idx<64; ) {
+ coeff_idx = 0;
+ for (;;) {
if (vp56_rac_get_prob(c, model2[0])) {
if (vp56_rac_get_prob(c, model2[2])) {
if (vp56_rac_get_prob(c, model2[3])) {
@@ -222,8 +223,11 @@ static void vp5_parse_coeff(VP56Context *s)
ct = 0;
s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 0;
}
+ coeff_idx++;
+ if (coeff_idx >= 64)
+ break;
- cg = vp5_coeff_groups[++coeff_idx];
+ cg = vp5_coeff_groups[coeff_idx];
ctx = s->coeff_ctx[vp56_b6to4[b]][coeff_idx];
model1 = model->coeff_ract[pt][ct][cg];
model2 = cg > 2 ? model1 : model->coeff_acct[pt][ct][cg][ctx];