changeset 12335:3ce688a83319 libavcodec

prevent access to vp8_coeff_band[16]
author skal
date Sun, 01 Aug 2010 23:20:06 +0000
parents 435319d67bd8
children e84378ff89ca
files vp8.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/vp8.c	Sat Jul 31 23:13:15 2010 +0000
+++ b/vp8.c	Sun Aug 01 23:20:06 2010 +0000
@@ -822,11 +822,11 @@
 
 skip_eob:
         if (!vp56_rac_get_prob_branchy(c, token_prob[1])) { // DCT_0
+            if (++i == 16)
+                return nonzero; // invalid input; blocks should end with EOB
             zero_nhood = 0;
-            token_prob = probs[vp8_coeff_band[++i]][0];
-            if (i < 16)
-                goto skip_eob;
-            return nonzero; // invalid input; blocks should end with EOB
+            token_prob = probs[vp8_coeff_band[i]][0];
+            goto skip_eob;
         }
 
         if (!vp56_rac_get_prob_branchy(c, token_prob[2])) { // DCT_1