X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fvp6.c;h=84876b7146450222095287f76d8a9866d81bbd0d;hb=dd3ca3ea15392da8636c06764e2da31e6ca700f0;hp=29fcecdb57d5e219575022b3cc9d86d8a8258881;hpb=13b7781ec8d475513c1ee40a6e481763b728a71e;p=ffmpeg diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 29fcecdb57d..84876b71464 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -442,7 +442,8 @@ static void vp6_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 ((coeff_idx>1 && ct==0) || vp56_rac_get_prob(c, model2[0])) { /* parse a coeff */ if (vp56_rac_get_prob(c, model2[2])) { @@ -483,8 +484,10 @@ static void vp6_parse_coeff(VP56Context *s) run += vp56_rac_get_prob(c, model3[i+8]) << i; } } - - cg = vp6_coeff_groups[coeff_idx+=run]; + coeff_idx += run; + if (coeff_idx >= 64) + break; + cg = vp6_coeff_groups[coeff_idx]; model1 = model2 = model->coeff_ract[pt][ct][cg]; }