}
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);
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];
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);
/* 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;