[FFmpeg-cvslog] png: use av_mallocz_array() for the zlib zalloc function
Justin Ruggles
git at videolan.org
Tue Mar 12 21:46:07 CET 2013
ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Wed Jan 16 18:10:57 2013 -0500| [486f0b0cfc800cd38ec06635630539431d296774] | committer: Justin Ruggles
png: use av_mallocz_array() for the zlib zalloc function
Fixes valgrind uninitialized memory errors when decoding png.
CC:libav-stable at libav.org
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=486f0b0cfc800cd38ec06635630539431d296774
---
libavcodec/png.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libavcodec/png.c b/libavcodec/png.c
index 70a080e..65d6964 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)
More information about the ffmpeg-cvslog
mailing list