1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

avcodec/cngenc: Use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-04-22 02:38:03 +02:00
parent 0dadbbbfd1
commit 78fb5f6e2a

View File

@ -56,8 +56,8 @@ static av_cold int cng_encode_init(AVCodecContext *avctx)
p->order = 10; p->order = 10;
if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0) if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0)
return ret; return ret;
p->samples32 = av_malloc(avctx->frame_size * sizeof(*p->samples32)); p->samples32 = av_malloc_array(avctx->frame_size, sizeof(*p->samples32));
p->ref_coef = av_malloc(p->order * sizeof(*p->ref_coef)); p->ref_coef = av_malloc_array(p->order, sizeof(*p->ref_coef));
if (!p->samples32 || !p->ref_coef) { if (!p->samples32 || !p->ref_coef) {
cng_encode_close(avctx); cng_encode_close(avctx);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);