[FFmpeg-cvslog] avcodec/pngdec: Use av_malloc_array()

Michael Niedermayer git at videolan.org
Sun Oct 11 16:55:29 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Oct 11 16:39:41 2015 +0200| [98b8bf12bcf5418ccbbe0c23933f5d1b25d94ddd] | committer: Michael Niedermayer

avcodec/pngdec: Use av_malloc_array()

Suggested-by: ubitux
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98b8bf12bcf5418ccbbe0c23933f5d1b25d94ddd
---

 libavcodec/pngdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index a998b1d..4cfdc58 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -980,7 +980,7 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
         return AVERROR_PATCHWELCOME;
     }
 
-    buffer = av_malloc(s->image_linesize * s->height);
+    buffer = av_malloc_array(s->image_linesize, s->height);
     if (!buffer)
         return AVERROR(ENOMEM);
 



More information about the ffmpeg-cvslog mailing list