mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/libmp3lame: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c4d85fc23c
commit
7532f0e14c
@ -146,7 +146,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
|
|||||||
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLTP) {
|
if (avctx->sample_fmt == AV_SAMPLE_FMT_FLTP) {
|
||||||
int ch;
|
int ch;
|
||||||
for (ch = 0; ch < avctx->channels; ch++) {
|
for (ch = 0; ch < avctx->channels; ch++) {
|
||||||
s->samples_flt[ch] = av_malloc(avctx->frame_size *
|
s->samples_flt[ch] = av_malloc_array(avctx->frame_size,
|
||||||
sizeof(*s->samples_flt[ch]));
|
sizeof(*s->samples_flt[ch]));
|
||||||
if (!s->samples_flt[ch]) {
|
if (!s->samples_flt[ch]) {
|
||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user