summaryrefslogtreecommitdiff
path: root/libavcodec/asv1.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-01-15 14:26:55 +0100
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-01-17 20:16:35 +0100
commit3b55429d5692dd782d8b3ce6a19819305157d1b8 (patch)
tree489c7014c1e3843253cb17e53f3d3950967b312f /libavcodec/asv1.c
parenta129622390fca8a298c3b121f42b2d15910b9b22 (diff)
Add and use av_fast_padded_malloc.
The same as av_fast_malloc but uses av_mallocz and keeps extra always-0 padding. This does not mean the memory will be 0-initialized after each call, but actually only after each growth of the buffer. However this makes sure that a) all data anywhere in the buffer is always initialized b) the padding is always 0 c) the user does not have to bother with adding the padding themselves Fixes another valgrind warning about use of uninitialized data, this time with fate-vsynth1-jpegls. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/asv1.c')
-rw-r--r--libavcodec/asv1.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c
index a2519cb5c2..9eeec2675a 100644
--- a/libavcodec/asv1.c
+++ b/libavcodec/asv1.c
@@ -408,10 +408,9 @@ static int decode_frame(AVCodecContext *avctx,
p->pict_type= AV_PICTURE_TYPE_I;
p->key_frame= 1;
- av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ av_fast_padded_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_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);