4xm: clear FF_INPUT_BUFFER_PADDING_SIZE bytes in temporary buffers
authorLaurent Aimar <fenrir@videolan.org>
Sun, 2 Oct 2011 00:48:11 +0000 (00:48 +0000)
committerJanne Grunau <janne-libav@jannau.net>
Mon, 10 Oct 2011 19:37:35 +0000 (21:37 +0200)
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
libavcodec/4xm.c

index 847ebce..d428f53 100644 (file)
@@ -399,6 +399,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
     if (!f->bitstream_buffer)
         return AVERROR(ENOMEM);
     f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra), bitstream_size/4);
+    memset((uint8_t*)f->bitstream_buffer + bitstream_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
     init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
 
     f->wordstream= (const uint16_t*)(buf + extra + bitstream_size);
@@ -679,6 +680,7 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length){
     if (!f->bitstream_buffer)
         return AVERROR(ENOMEM);
     f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream, prestream_size/4);
+    memset((uint8_t*)f->bitstream_buffer + prestream_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
     init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
 
     f->last_dc= 0*128*8*8;