Merge commit 'be373cb50d3c411366fec7eef2eb3681abe48f96'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 13 Jun 2013 11:56:14 +0000 (13:56 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 13 Jun 2013 11:57:07 +0000 (13:57 +0200)
* commit 'be373cb50d3c411366fec7eef2eb3681abe48f96':
  4xm: do not overread the prestream buffer

Conflicts:
libavcodec/4xm.c

See: 9c661e95
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/4xm.c

@@@ -603,7 -579,8 +603,8 @@@ static int decode_i_mb(FourXContext *f
  }
  
  static const uint8_t *read_huffman_tables(FourXContext *f,
-                                           const uint8_t * const buf, int buf_size)
+                                           const uint8_t * const buf,
 -                                          int len)
++                                          int buf_size)
  {
      int frequency[512] = { 0 };
      uint8_t flag[512];
      for (;;) {
          int i;
  
 -        len -= end - start + 1;
 -
 -        if (end < start || len < 0)
 +        if (ptr_end - ptr < FFMAX(end - start + 1, 0) + 1) {
 +            av_log(f->avctx, AV_LOG_ERROR, "invalid data in read_huffman_tables\n");
              return NULL;
 +        }
          for (i = start; i <= end; i++)
              frequency[i] = *ptr++;
          start = *ptr++;