1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/cngdec: use av_mallocz_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-04-09 23:18:32 +02:00
parent 2773ab36cc
commit f703dae7aa

View File

@ -59,12 +59,12 @@ static av_cold int cng_decode_init(AVCodecContext *avctx)
p->order = 12;
avctx->frame_size = 640;
p->refl_coef = av_mallocz(p->order * sizeof(*p->refl_coef));
p->target_refl_coef = av_mallocz(p->order * sizeof(*p->target_refl_coef));
p->lpc_coef = av_mallocz(p->order * sizeof(*p->lpc_coef));
p->filter_out = av_mallocz((avctx->frame_size + p->order) *
p->refl_coef = av_mallocz_array(p->order, sizeof(*p->refl_coef));
p->target_refl_coef = av_mallocz_array(p->order, sizeof(*p->target_refl_coef));
p->lpc_coef = av_mallocz_array(p->order, sizeof(*p->lpc_coef));
p->filter_out = av_mallocz_array(avctx->frame_size + p->order,
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 ||
!p->filter_out || !p->excitation) {
cng_decode_close(avctx);