Commit 6779bf3f authored by Paul B Mahol's avatar Paul B Mahol

avformat/wavenc: use av_mallocz_array()

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent c6c172d1
...@@ -173,8 +173,8 @@ static av_cold int peak_init_writer(AVFormatContext *s) ...@@ -173,8 +173,8 @@ static av_cold int peak_init_writer(AVFormatContext *s)
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
wav->peak_maxpos = av_mallocz(enc->channels * sizeof(*wav->peak_maxpos)); wav->peak_maxpos = av_mallocz_array(enc->channels, sizeof(*wav->peak_maxpos));
wav->peak_maxneg = av_mallocz(enc->channels * sizeof(*wav->peak_maxneg)); wav->peak_maxneg = av_mallocz_array(enc->channels, sizeof(*wav->peak_maxneg));
wav->peak_output = av_malloc(PEAK_BUFFER_SIZE); wav->peak_output = av_malloc(PEAK_BUFFER_SIZE);
if (!wav->peak_maxpos || !wav->peak_maxneg || !wav->peak_output) if (!wav->peak_maxpos || !wav->peak_maxneg || !wav->peak_output)
goto nomem; goto nomem;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment