mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
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:
parent
cf04af2086
commit
b44925ae6b
@ -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++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user