Merge commit 'e818da77240146b36d6669b1c4e0565239dc55d3' into release/2.4
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Mar 2015 00:18:06 +0000 (01:18 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Mar 2015 00:18:06 +0000 (01:18 +0100)
* commit 'e818da77240146b36d6669b1c4e0565239dc55d3':
  eamad: check for out of bounds read

Conflicts:
libavcodec/eamad.c

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

@@@ -151,6 -145,11 +151,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;