From b44925ae6b4bb7b9409053265005d9acada82057 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 1 Jul 2013 10:01:16 +0200 Subject: [PATCH] jpeg2000: Initialize code blocks structures in precincts to 0 Prevent use of uninitialized memory / valgrind failure. Found-by: ubitux Signed-off-by: Michael Niedermayer Signed-off-by: Luca Barbato --- libavcodec/jpeg2000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index 51823e6..cd6f58d 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -416,9 +416,9 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, if (!prec->zerobits) return AVERROR(ENOMEM); - prec->cblk = av_malloc_array(prec->nb_codeblocks_width * - prec->nb_codeblocks_height, - sizeof(*prec->cblk)); + prec->cblk = av_mallocz_array(prec->nb_codeblocks_width * + prec->nb_codeblocks_height, + sizeof(*prec->cblk)); if (!prec->cblk) return AVERROR(ENOMEM); for (cblkno = 0; cblkno < prec->nb_codeblocks_width * prec->nb_codeblocks_height; cblkno++) { -- 2.7.4