summaryrefslogtreecommitdiff
path: root/libavfilter/af_join.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-01-20 16:41:18 +0000
committerPaul B Mahol <onemda@gmail.com>2015-01-20 16:45:19 +0000
commit357c6a92bc94c39c95875672679031bf72ae0e82 (patch)
tree85de0ab94dc5c9295f2015526a5b461253f0ec60 /libavfilter/af_join.c
parent081e117bfee0e2a1586fff00b82c7d59631d9775 (diff)
downloadffmpeg-357c6a92bc94c39c95875672679031bf72ae0e82.tar.gz
avfilter/af_join: Use av_mallocz_array()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_join.c')
-rw-r--r--libavfilter/af_join.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
index 71a454bba7..ffc7bc5d74 100644
--- a/libavfilter/af_join.c
+++ b/libavfilter/af_join.c
@@ -193,9 +193,9 @@ static av_cold int join_init(AVFilterContext *ctx)
}
s->nb_channels = av_get_channel_layout_nb_channels(s->channel_layout);
- s->channels = av_mallocz(sizeof(*s->channels) * s->nb_channels);
- s->buffers = av_mallocz(sizeof(*s->buffers) * s->nb_channels);
- s->input_frames = av_mallocz(sizeof(*s->input_frames) * s->inputs);
+ s->channels = av_mallocz_array(sizeof(*s->channels), s->nb_channels);
+ s->buffers = av_mallocz_array(sizeof(*s->buffers), s->nb_channels);
+ s->input_frames = av_mallocz_array(sizeof(*s->input_frames), s->inputs);
if (!s->channels || !s->buffers|| !s->input_frames)
return AVERROR(ENOMEM);
@@ -308,7 +308,7 @@ static int join_config_output(AVFilterLink *outlink)
int i, ret = 0;
/* initialize inputs to user-specified mappings */
- if (!(inputs = av_mallocz(sizeof(*inputs) * ctx->nb_inputs)))
+ if (!(inputs = av_mallocz_array(sizeof(*inputs), ctx->nb_inputs)))
return AVERROR(ENOMEM);
for (i = 0; i < s->nb_channels; i++) {
ChannelMap *ch = &s->channels[i];
@@ -414,7 +414,7 @@ static int join_request_frame(AVFilterLink *outlink)
if (!frame)
return AVERROR(ENOMEM);
if (s->nb_channels > FF_ARRAY_ELEMS(frame->data)) {
- frame->extended_data = av_mallocz(s->nb_channels *
+ frame->extended_data = av_mallocz_array(s->nb_channels,
sizeof(*frame->extended_data));
if (!frame->extended_data) {
ret = AVERROR(ENOMEM);
@@ -448,7 +448,7 @@ static int join_request_frame(AVFilterLink *outlink)
/* create references to the buffers we copied to output */
if (nb_buffers > FF_ARRAY_ELEMS(frame->buf)) {
frame->nb_extended_buf = nb_buffers - FF_ARRAY_ELEMS(frame->buf);
- frame->extended_buf = av_mallocz(sizeof(*frame->extended_buf) *
+ frame->extended_buf = av_mallocz_array(sizeof(*frame->extended_buf),
frame->nb_extended_buf);
if (!frame->extended_buf) {
frame->nb_extended_buf = 0;