avcodec/faxcompr: use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Apr 2014 13:37:57 +0000 (15:37 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Apr 2014 13:37:57 +0000 (15:37 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/faxcompr.c

index 900851b..155f78d 100644 (file)
@@ -287,8 +287,8 @@ int ff_ccitt_unpack(AVCodecContext *avctx, const uint8_t *src, int srcsize,
     int runsize = avctx->width + 2;
     int has_eol;
 
     int runsize = avctx->width + 2;
     int has_eol;
 
-    runs = av_malloc(runsize * sizeof(runs[0]));
-    ref  = av_malloc(runsize * sizeof(ref[0]));
+    runs = av_malloc_array(runsize, sizeof(runs[0]));
+    ref  = av_malloc_array(runsize, sizeof(ref[0]));
     if (!runs || !ref) {
         ret = AVERROR(ENOMEM);
         goto fail;
     if (!runs || !ref) {
         ret = AVERROR(ENOMEM);
         goto fail;