diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2013-01-16 18:10:57 -0500 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-03-09 18:10:16 +0100 |
commit | 905f5c8a1e94d224245480298b1854e103d71141 (patch) | |
tree | 11d1cb082cb2dac1e9a797d78f2f4429f19f4ccb | |
parent | 20373a66ec68d958c266f643a7d0e5ec254c0fcc (diff) | |
download | ffmpeg-905f5c8a1e94d224245480298b1854e103d71141.tar.gz |
png: use av_mallocz_array() for the zlib zalloc function
Fixes valgrind uninitialized memory errors when decoding png.
CC:libav-stable@libav.org
(cherry picked from commit 486f0b0cfc800cd38ec06635630539431d296774)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/png.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/png.c b/libavcodec/png.c index 70a080e29e..65d696476a 100644 --- a/libavcodec/png.c +++ b/libavcodec/png.c @@ -47,9 +47,7 @@ const uint8_t ff_png_pass_mask[NB_PASSES] = { void *ff_png_zalloc(void *opaque, unsigned int items, unsigned int size) { - if(items >= UINT_MAX / size) - return NULL; - return av_malloc(items * size); + return av_mallocz_array(items, size); } void ff_png_zfree(void *opaque, void *ptr) |