Merge commit '905988fe1a8accbc1ab93120aa4cd29252b81cce' into release/0.10
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Mar 2015 21:50:00 +0000 (22:50 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Mar 2015 21:50:00 +0000 (22:50 +0100)
* commit '905988fe1a8accbc1ab93120aa4cd29252b81cce':
  eamad: check for out of bounds read

Conflicts:
libavcodec/eamad.c

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

@@@ -144,6 -138,11 +144,11 @@@ static inline int decode_block_intra(Ma
                  break;
              } else if (level != 0) {
                  i += run;
 -                    return;
+                 if (i > 63) {
+                     av_log(s->avctx, AV_LOG_ERROR,
+                            "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
++                    return -1;
+                 }
                  j = scantable[i];
                  level = (level*quant_matrix[j]) >> 4;
                  level = (level-1)|1;
                  run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
  
                  i += run;
 -                    return;
+                 if (i > 63) {
+                     av_log(s->avctx, AV_LOG_ERROR,
+                            "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
++                    return -1;
+                 }
                  j = scantable[i];
                  if (level < 0) {
                      level = -level;