aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-06-06 22:02:54 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-06-06 22:02:54 +0200
commitffb1051b9b9b876aba109d6ae402ab3a50183554 (patch)
tree346c772d3f51d835a03f2c6931cf4ccc45d621af
parent7c3a296b4f1f7fb663812533ef2c87b828a8e8aa (diff)
downloadffmpeg-ffb1051b9b9b876aba109d6ae402ab3a50183554.tar.gz
jpeg2000: Zero prec->cblk
Prevent use of uninitialized memory / valgrind failure Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/jpeg2000.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index a2c3e47bad..947a745e00 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -424,9 +424,9 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
if (!prec->zerobits)
return AVERROR(ENOMEM);
- prec->cblk = av_malloc_array(prec->nb_codeblocks_width *
- (uint64_t)prec->nb_codeblocks_height,
- sizeof(*prec->cblk));
+ prec->cblk = av_mallocz_array(prec->nb_codeblocks_width *
+ (uint64_t)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++) {