diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-14 21:31:53 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-20 01:03:52 +0200 |
commit | 1ea365082318f06cd42a8b37dd0c7724b599c821 (patch) | |
tree | 4df48a8b9f4614803fd2a88c29ad2ff7f7070294 /libavcodec/alsdec.c | |
parent | 4b154743163ffbe3fdc50759c0c55dc854636488 (diff) | |
download | ffmpeg-1ea365082318f06cd42a8b37dd0c7724b599c821.tar.gz |
Replace all occurences of av_mallocz_array() by av_calloc()
They do the same.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r-- | libavcodec/alsdec.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index ba873ec53a..9e1aaf065a 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -2059,7 +2059,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->shift_lsbs = av_malloc_array(num_buffers, sizeof(*ctx->shift_lsbs)); ctx->opt_order = av_malloc_array(num_buffers, sizeof(*ctx->opt_order)); ctx->store_prev_samples = av_malloc_array(num_buffers, sizeof(*ctx->store_prev_samples)); - ctx->use_ltp = av_mallocz_array(num_buffers, sizeof(*ctx->use_ltp)); + ctx->use_ltp = av_calloc(num_buffers, sizeof(*ctx->use_ltp)); ctx->ltp_lag = av_malloc_array(num_buffers, sizeof(*ctx->ltp_lag)); ctx->ltp_gain = av_malloc_array(num_buffers, sizeof(*ctx->ltp_gain)); ctx->ltp_gain_buffer = av_malloc_array(num_buffers * 5, sizeof(*ctx->ltp_gain_buffer)); @@ -2078,10 +2078,9 @@ static av_cold int decode_init(AVCodecContext *avctx) // allocate and assign channel data buffer for mcc mode if (sconf->mc_coding) { - ctx->chan_data_buffer = av_mallocz_array(num_buffers * num_buffers, - sizeof(*ctx->chan_data_buffer)); - ctx->chan_data = av_mallocz_array(num_buffers, - sizeof(*ctx->chan_data)); + ctx->chan_data_buffer = av_calloc(num_buffers * num_buffers, + sizeof(*ctx->chan_data_buffer)); + ctx->chan_data = av_calloc(num_buffers, sizeof(*ctx->chan_data)); ctx->reverted_channels = av_malloc_array(num_buffers, sizeof(*ctx->reverted_channels)); @@ -2102,7 +2101,7 @@ static av_cold int decode_init(AVCodecContext *avctx) channel_size = sconf->frame_length + sconf->max_order; ctx->prev_raw_samples = av_malloc_array(sconf->max_order, sizeof(*ctx->prev_raw_samples)); - ctx->raw_buffer = av_mallocz_array(avctx->channels * channel_size, sizeof(*ctx->raw_buffer)); + ctx->raw_buffer = av_calloc(avctx->channels * channel_size, sizeof(*ctx->raw_buffer)); ctx->raw_samples = av_malloc_array(avctx->channels, sizeof(*ctx->raw_samples)); if (sconf->floating) { @@ -2110,7 +2109,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->shift_value = av_malloc_array(avctx->channels, sizeof(*ctx->shift_value)); ctx->last_shift_value = av_malloc_array(avctx->channels, sizeof(*ctx->last_shift_value)); ctx->last_acf_mantissa = av_malloc_array(avctx->channels, sizeof(*ctx->last_acf_mantissa)); - ctx->raw_mantissa = av_mallocz_array(avctx->channels, sizeof(*ctx->raw_mantissa)); + ctx->raw_mantissa = av_calloc(avctx->channels, sizeof(*ctx->raw_mantissa)); ctx->larray = av_malloc_array(ctx->cur_frame_length * 4, sizeof(*ctx->larray)); ctx->nbits = av_malloc_array(ctx->cur_frame_length, sizeof(*ctx->nbits)); @@ -2127,7 +2126,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ff_mlz_flush_dict(ctx->mlz); for (c = 0; c < avctx->channels; ++c) { - ctx->raw_mantissa[c] = av_mallocz_array(ctx->cur_frame_length, sizeof(**ctx->raw_mantissa)); + ctx->raw_mantissa[c] = av_calloc(ctx->cur_frame_length, sizeof(**ctx->raw_mantissa)); } } |