mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/segment: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
4aa7848eb8
commit
1394e0a9e0
@ -373,7 +373,7 @@ static int parse_times(void *log_ctx, int64_t **times, int *nb_times,
|
||||
if (*p == ',')
|
||||
(*nb_times)++;
|
||||
|
||||
*times = av_malloc(sizeof(**times) * *nb_times);
|
||||
*times = av_malloc_array(*nb_times, sizeof(**times));
|
||||
if (!*times) {
|
||||
av_log(log_ctx, AV_LOG_ERROR, "Could not allocate forced times array\n");
|
||||
FAIL(AVERROR(ENOMEM));
|
||||
@ -431,7 +431,7 @@ static int parse_frames(void *log_ctx, int **frames, int *nb_frames,
|
||||
if (*p == ',')
|
||||
(*nb_frames)++;
|
||||
|
||||
*frames = av_malloc(sizeof(**frames) * *nb_frames);
|
||||
*frames = av_malloc_array(*nb_frames, sizeof(**frames));
|
||||
if (!*frames) {
|
||||
av_log(log_ctx, AV_LOG_ERROR, "Could not allocate forced frames array\n");
|
||||
FAIL(AVERROR(ENOMEM));
|
||||
|
Loading…
Reference in New Issue
Block a user