mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 08:12:44 +00:00
avdevice/alsa-audio-common: Use *alloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
be1b8b4da5
commit
48895a23fc
@ -280,7 +280,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
|
||||
}
|
||||
if (s->reorder_func) {
|
||||
s->reorder_buf_size = buffer_size;
|
||||
s->reorder_buf = av_malloc(s->reorder_buf_size * s->frame_size);
|
||||
s->reorder_buf = av_malloc_array(s->reorder_buf_size, s->frame_size);
|
||||
if (!s->reorder_buf)
|
||||
goto fail1;
|
||||
}
|
||||
@ -336,7 +336,7 @@ int ff_alsa_extend_reorder_buf(AlsaData *s, int min_size)
|
||||
av_assert0(size != 0);
|
||||
while (size < min_size)
|
||||
size *= 2;
|
||||
r = av_realloc(s->reorder_buf, size * s->frame_size);
|
||||
r = av_realloc_array(s->reorder_buf, size, s->frame_size);
|
||||
if (!r)
|
||||
return AVERROR(ENOMEM);
|
||||
s->reorder_buf = r;
|
||||
|
Loading…
Reference in New Issue
Block a user