Commit ffb1051b authored by Michael Niedermayer's avatar Michael Niedermayer

jpeg2000: Zero prec->cblk

Prevent use of uninitialized memory / valgrind failure

Found-by: ubitux
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7c3a296b
......@@ -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++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment