diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-01 12:01:16 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-07-02 22:05:45 +0400 |
commit | b44925ae6b4bb7b9409053265005d9acada82057 (patch) | |
tree | 4af0b8155528863fed7254e761e32d4d0e345f68 /libavcodec/jpeg2000.c | |
parent | cf04af2086be105ff86088357b83d672d38417d9 (diff) |
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>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r-- | libavcodec/jpeg2000.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index 51823e6cd7..cd6f58de0e 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -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++) { |