summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-24 02:31:20 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-25 00:43:14 +0100
commit01df2a13c32a28cd5a5b27098aa2b4b32a3d76e4 (patch)
tree03873309edc678847358ede122debecacf2ea888 /libavcodec/utils.c
parent4f112a8e34022c821be885ed293abc0b120c875b (diff)
avcodec/utils: initialize pixel buffer pool
This should silence many valgrind warnings about use of uninitialized data, all the warnings i looked at where false positives having their uninitialized data not actually used. The same effect could be achieved by listing all code that touches the pixel buffer in the valgrind suppression file. Note, valgrind also fails to trace the origins correctly. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 70c6129f75..d1b977e0e4 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -408,7 +408,10 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame)
av_buffer_pool_uninit(&pool->pools[i]);
pool->linesize[i] = picture.linesize[i];
if (size[i]) {
- pool->pools[i] = av_buffer_pool_init(size[i] + 16, NULL);
+ pool->pools[i] = av_buffer_pool_init(size[i] + 16,
+ CONFIG_MEMORY_POISONING ?
+ NULL :
+ av_buffer_allocz);
if (!pool->pools[i]) {
ret = AVERROR(ENOMEM);
goto fail;