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)
|
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++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user