Merge commit '3f09d4f6d43468dbc9307bb937516a32287008dc' into release/2.4
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Jan 2015 02:21:35 +0000 (03:21 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Jan 2015 02:21:35 +0000 (03:21 +0100)
* commit '3f09d4f6d43468dbc9307bb937516a32287008dc':
  ffv1: fix out-of-bounds read

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/ffv1enc.c

@@@ -166,9 -71,9 +166,9 @@@ static void find_best_state(uint8_t bes
                      best_len[k]      = len;
                      best_state[i][k] = j;
                  }
-                 for (m = 0; m < 256; m++)
+                 for (m = 1; m < 256; m++)
                      if (occ[m]) {
 -                        newocc[one_state[m]]             += occ[m] * p;
 +                        newocc[      one_state[      m]] += occ[m] * p;
                          newocc[256 - one_state[256 - m]] += occ[m] * (1 - p);
                      }
                  memcpy(occ, newocc, sizeof(occ));