avcodec/pngdec: Use av_malloc_array()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 11 Oct 2015 14:39:41 +0000 (16:39 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 11 Oct 2015 14:39:41 +0000 (16:39 +0200)
Suggested-by: ubitux
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pngdec.c

index a998b1d..4cfdc58 100644 (file)
@@ -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);