From 1f4ef3ccaee64d38ccbcb040c024193d2b3bebf2 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 17 Jan 2015 12:58:56 +0100 Subject: [PATCH] avcodec/libopusenc: Use av_mallocz_array() Signed-off-by: Michael Niedermayer --- libavcodec/libopusenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index 6bb48628ab..785460972d 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -277,7 +277,7 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx) } avctx->extradata_size = header_size; - opus->samples = av_mallocz(frame_size * avctx->channels * + opus->samples = av_mallocz_array(frame_size, avctx->channels * av_get_bytes_per_sample(avctx->sample_fmt)); if (!opus->samples) { av_log(avctx, AV_LOG_ERROR, "Failed to allocate samples buffer.\n"); -- 2.11.0