jpeg2000: Initialize code blocks structures in precincts to 0

Prevent use of uninitialized memory / valgrind failure.

Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Michael Niedermayer 2013-07-01 10:01:16 +02:00 committed by Luca Barbato
parent cf04af2086
commit b44925ae6b
1 changed files with 3 additions and 3 deletions

View File

@ -416,9 +416,9 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
if (!prec->zerobits) if (!prec->zerobits)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
prec->cblk = av_malloc_array(prec->nb_codeblocks_width * prec->cblk = av_mallocz_array(prec->nb_codeblocks_width *
prec->nb_codeblocks_height, prec->nb_codeblocks_height,
sizeof(*prec->cblk)); sizeof(*prec->cblk));
if (!prec->cblk) if (!prec->cblk)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
for (cblkno = 0; cblkno < prec->nb_codeblocks_width * prec->nb_codeblocks_height; cblkno++) { for (cblkno = 0; cblkno < prec->nb_codeblocks_width * prec->nb_codeblocks_height; cblkno++) {