4xm: add assert to check that the pointer from read_huffman_tables is within the...
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 26 Jan 2013 01:05:32 +0000 (02:05 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 26 Jan 2013 01:27:19 +0000 (02:27 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/4xm.c

index 39254f7..9ea8436 100644 (file)
@@ -760,6 +760,8 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
     if (!prestream)
         return -1;
 
     if (!prestream)
         return -1;
 
+    av_assert0(prestream <= buf + length);
+
     init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);
 
     prestream_size = length + buf - prestream;
     init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);
 
     prestream_size = length + buf - prestream;