[FFmpeg-devel] [PATCH 5/7] Clear FF_INPUT_BUFFER_PADDING_SIZE bytes at the end of the temporary buffers used in 4xm decoder.
fenrir at elivagar.org
fenrir at elivagar.org
Sun Oct 2 00:38:30 CEST 2011
From: Laurent Aimar <fenrir at videolan.org>
---
libavcodec/4xm.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 6ee9b34..a17a9c9 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -412,6 +412,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);
@@ -706,6 +707,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;
--
1.7.2.5
More information about the ffmpeg-devel
mailing list