mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-24 03:59:43 +00:00
jpeg2000: Zero prec->cblk
Prevent use of uninitialized memory / valgrind failure Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
7c3a296b4f
commit
ffb1051b9b
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user