avformat/wavenc: use av_mallocz_array()
authorPaul B Mahol <onemda@gmail.com>
Fri, 11 Jul 2014 10:38:45 +0000 (10:38 +0000)
committerPaul B Mahol <onemda@gmail.com>
Fri, 11 Jul 2014 10:38:45 +0000 (10:38 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/wavenc.c

index 123dd45..c73c900 100644 (file)
@@ -173,8 +173,8 @@ static av_cold int peak_init_writer(AVFormatContext *s)
         return AVERROR(EINVAL);
     }
 
-    wav->peak_maxpos = av_mallocz(enc->channels * sizeof(*wav->peak_maxpos));
-    wav->peak_maxneg = av_mallocz(enc->channels * sizeof(*wav->peak_maxneg));
+    wav->peak_maxpos = av_mallocz_array(enc->channels, sizeof(*wav->peak_maxpos));
+    wav->peak_maxneg = av_mallocz_array(enc->channels, sizeof(*wav->peak_maxneg));
     wav->peak_output = av_malloc(PEAK_BUFFER_SIZE);
     if (!wav->peak_maxpos || !wav->peak_maxneg || !wav->peak_output)
         goto nomem;