Commit f703dae7 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/cngdec: use av_mallocz_array()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2773ab36
...@@ -59,12 +59,12 @@ static av_cold int cng_decode_init(AVCodecContext *avctx) ...@@ -59,12 +59,12 @@ static av_cold int cng_decode_init(AVCodecContext *avctx)
p->order = 12; p->order = 12;
avctx->frame_size = 640; avctx->frame_size = 640;
p->refl_coef = av_mallocz(p->order * sizeof(*p->refl_coef)); p->refl_coef = av_mallocz_array(p->order, sizeof(*p->refl_coef));
p->target_refl_coef = av_mallocz(p->order * sizeof(*p->target_refl_coef)); p->target_refl_coef = av_mallocz_array(p->order, sizeof(*p->target_refl_coef));
p->lpc_coef = av_mallocz(p->order * sizeof(*p->lpc_coef)); p->lpc_coef = av_mallocz_array(p->order, sizeof(*p->lpc_coef));
p->filter_out = av_mallocz((avctx->frame_size + p->order) * p->filter_out = av_mallocz_array(avctx->frame_size + p->order,
sizeof(*p->filter_out)); sizeof(*p->filter_out));
p->excitation = av_mallocz(avctx->frame_size * sizeof(*p->excitation)); p->excitation = av_mallocz_array(avctx->frame_size, sizeof(*p->excitation));
if (!p->refl_coef || !p->target_refl_coef || !p->lpc_coef || if (!p->refl_coef || !p->target_refl_coef || !p->lpc_coef ||
!p->filter_out || !p->excitation) { !p->filter_out || !p->excitation) {
cng_decode_close(avctx); cng_decode_close(avctx);
......
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