mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/wavenc: use av_mallocz_array()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
c6c172d173
commit
6779bf3f0f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user