[FFmpeg-devel] [PATCH] Fix uninitialized reads for fate-vsynth1-asv2 test.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 15 11:04:23 CET 2012


This is not a real error and memsetting always even when the
size did not change is overkill, but I'd still like to propose
this.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavcodec/asv1.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c
index ab5ac8d..a2519cb 100644
--- a/libavcodec/asv1.c
+++ b/libavcodec/asv1.c
@@ -411,6 +411,7 @@ static int decode_frame(AVCodecContext *avctx,
     av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!a->bitstream_buffer)
         return AVERROR(ENOMEM);
+    memset(a->bitstream_buffer + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
 
     if(avctx->codec_id == CODEC_ID_ASV1)
         a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (const uint32_t*)buf, buf_size/4);
-- 
1.7.8.3



More information about the ffmpeg-devel mailing list