Commit 53487268 authored by Michael Niedermayer's avatar Michael Niedermayer

cmdutils: use av_mallocz_array()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c8a1f10c
...@@ -662,7 +662,7 @@ static void init_parse_context(OptionParseContext *octx, ...@@ -662,7 +662,7 @@ static void init_parse_context(OptionParseContext *octx,
memset(octx, 0, sizeof(*octx)); memset(octx, 0, sizeof(*octx));
octx->nb_groups = nb_groups; octx->nb_groups = nb_groups;
octx->groups = av_mallocz(sizeof(*octx->groups) * octx->nb_groups); octx->groups = av_mallocz_array(octx->nb_groups, sizeof(*octx->groups));
if (!octx->groups) if (!octx->groups)
exit_program(1); exit_program(1);
...@@ -1966,7 +1966,7 @@ AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, ...@@ -1966,7 +1966,7 @@ AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
if (!s->nb_streams) if (!s->nb_streams)
return NULL; return NULL;
opts = av_mallocz(s->nb_streams * sizeof(*opts)); opts = av_mallocz_array(s->nb_streams, sizeof(*opts));
if (!opts) { if (!opts) {
av_log(NULL, AV_LOG_ERROR, av_log(NULL, AV_LOG_ERROR,
"Could not alloc memory for stream options.\n"); "Could not alloc memory for stream options.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment