Merge commit '12dc01bb1f07112cd7eb31e183d75cb3c0fb92ca' into release/0.10
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Nov 2013 16:51:21 +0000 (17:51 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Nov 2013 16:51:21 +0000 (17:51 +0100)
* commit '12dc01bb1f07112cd7eb31e183d75cb3c0fb92ca':
  4xm: do not overread the prestream buffer

Conflicts:
libavcodec/4xm.c

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

@@@ -562,7 -535,10 +562,10 @@@ static int decode_i_mb(FourXContext *f)
      return 0;
  }
  
- static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf, int buf_size){
+ static const uint8_t *read_huffman_tables(FourXContext *f,
+                                           const uint8_t * const buf,
 -                                          int len)
++                                          int buf_size)
+ {
      int frequency[512];
      uint8_t flag[512];
      int up[512];
      for(;;){
          int i;
  
 -        len -= end - start + 1;
 -
 -        if (end < start || len < 0)
 +        if (start <= end && ptr_end - ptr < end - start + 1 + 1)
 +            return NULL;
++        if (end < start || buf_size < 0)
+             return NULL;
          for(i=start; i<=end; i++){
              frequency[i]= *ptr++;
          }