summaryrefslogtreecommitdiff
path: root/fftools
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-14 21:31:53 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-20 01:03:52 +0200
commit1ea365082318f06cd42a8b37dd0c7724b599c821 (patch)
tree4df48a8b9f4614803fd2a88c29ad2ff7f7070294 /fftools
parent4b154743163ffbe3fdc50759c0c55dc854636488 (diff)
Replace all occurences of av_mallocz_array() by av_calloc()
They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'fftools')
-rw-r--r--fftools/cmdutils.c4
-rw-r--r--fftools/ffmpeg_opt.c8
-rw-r--r--fftools/ffprobe.c3
3 files changed, 7 insertions, 8 deletions
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index cd3f2bb2ae..2c8e98982f 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -689,7 +689,7 @@ static void init_parse_context(OptionParseContext *octx,
memset(octx, 0, sizeof(*octx));
octx->nb_groups = nb_groups;
- octx->groups = av_mallocz_array(octx->nb_groups, sizeof(*octx->groups));
+ octx->groups = av_calloc(octx->nb_groups, sizeof(*octx->groups));
if (!octx->groups)
exit_program(1);
@@ -2168,7 +2168,7 @@ AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
if (!s->nb_streams)
return NULL;
- opts = av_mallocz_array(s->nb_streams, sizeof(*opts));
+ opts = av_calloc(s->nb_streams, sizeof(*opts));
if (!opts) {
av_log(NULL, AV_LOG_ERROR,
"Could not alloc memory for stream options.\n");
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 6ca28cf974..8c1d96ccf8 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2591,7 +2591,7 @@ loop_end:
count = 0;
while (ost->enc->pix_fmts[count] != AV_PIX_FMT_NONE)
count++;
- f->formats = av_mallocz_array(count + 1, sizeof(*f->formats));
+ f->formats = av_calloc(count + 1, sizeof(*f->formats));
if (!f->formats)
exit_program(1);
memcpy(f->formats, ost->enc->pix_fmts, (count + 1) * sizeof(*f->formats));
@@ -2604,7 +2604,7 @@ loop_end:
count = 0;
while (ost->enc->sample_fmts[count] != AV_SAMPLE_FMT_NONE)
count++;
- f->formats = av_mallocz_array(count + 1, sizeof(*f->formats));
+ f->formats = av_calloc(count + 1, sizeof(*f->formats));
if (!f->formats)
exit_program(1);
memcpy(f->formats, ost->enc->sample_fmts, (count + 1) * sizeof(*f->formats));
@@ -2615,7 +2615,7 @@ loop_end:
count = 0;
while (ost->enc->supported_samplerates[count])
count++;
- f->sample_rates = av_mallocz_array(count + 1, sizeof(*f->sample_rates));
+ f->sample_rates = av_calloc(count + 1, sizeof(*f->sample_rates));
if (!f->sample_rates)
exit_program(1);
memcpy(f->sample_rates, ost->enc->supported_samplerates,
@@ -2627,7 +2627,7 @@ loop_end:
count = 0;
while (ost->enc->channel_layouts[count])
count++;
- f->channel_layouts = av_mallocz_array(count + 1, sizeof(*f->channel_layouts));
+ f->channel_layouts = av_calloc(count + 1, sizeof(*f->channel_layouts));
if (!f->channel_layouts)
exit_program(1);
memcpy(f->channel_layouts, ost->enc->channel_layouts,
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index d8e968321e..90e895bbf9 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3003,8 +3003,7 @@ static int open_input_file(InputFile *ifile, const char *filename,
av_dump_format(fmt_ctx, 0, filename, 0);
- ifile->streams = av_mallocz_array(fmt_ctx->nb_streams,
- sizeof(*ifile->streams));
+ ifile->streams = av_calloc(fmt_ctx->nb_streams, sizeof(*ifile->streams));
if (!ifile->streams)
exit(1);
ifile->nb_streams = fmt_ctx->nb_streams;