[FFmpeg-cvslog] avformat/wavenc: use av_mallocz_array()

Paul B Mahol git at videolan.org
Fri Jul 11 17:49:00 CEST 2014


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Jul 11 10:38:45 2014 +0000| [6779bf3f0fccad973c66af9894042fed19801b20] | committer: Paul B Mahol

avformat/wavenc: use av_mallocz_array()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavformat/wavenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index 123dd45..c73c900 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -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;



More information about the ffmpeg-cvslog mailing list