Browse Source

avcodec/libopusenc: Use av_mallocz_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.6
Michael Niedermayer 10 years ago
parent
commit
1f4ef3ccae
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/libopusenc.c

+ 1
- 1
libavcodec/libopusenc.c View File

@@ -277,7 +277,7 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx)
} }
avctx->extradata_size = header_size; 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)); av_get_bytes_per_sample(avctx->sample_fmt));
if (!opus->samples) { if (!opus->samples) {
av_log(avctx, AV_LOG_ERROR, "Failed to allocate samples buffer.\n"); av_log(avctx, AV_LOG_ERROR, "Failed to allocate samples buffer.\n");


Loading…
Cancel
Save