general: fix warning 'av_malloc_array' sizes specified with 'sizeof'

in the earlier argument and not in the later argument [-Wcalloc-transposed-args]

Fixes trac ticket #11620
This commit is contained in:
Baptiste Coudurier
2025-06-06 13:42:28 -07:00
parent 00225e9ebc
commit ef60d5ac32
11 changed files with 18 additions and 18 deletions

View File

@@ -361,9 +361,9 @@ static int config_input(AVFilterLink *inlink)
DenoiseState *st = &s->st[i];
st->rnn[0].model = s->model[0];
st->rnn[0].vad_gru_state = av_calloc(sizeof(float), FFALIGN(s->model[0]->vad_gru_size, 16));
st->rnn[0].noise_gru_state = av_calloc(sizeof(float), FFALIGN(s->model[0]->noise_gru_size, 16));
st->rnn[0].denoise_gru_state = av_calloc(sizeof(float), FFALIGN(s->model[0]->denoise_gru_size, 16));
st->rnn[0].vad_gru_state = av_calloc(FFALIGN(s->model[0]->vad_gru_size, 16), sizeof(float));
st->rnn[0].noise_gru_state = av_calloc(FFALIGN(s->model[0]->noise_gru_size, 16), sizeof(float));
st->rnn[0].denoise_gru_state = av_calloc(FFALIGN(s->model[0]->denoise_gru_size, 16), sizeof(float));
if (!st->rnn[0].vad_gru_state ||
!st->rnn[0].noise_gru_state ||
!st->rnn[0].denoise_gru_state)

View File

@@ -210,7 +210,7 @@ static int config_output(AVFilterLink *outlink)
{
AudioStatsContext *s = outlink->src->priv;
s->chstats = av_calloc(sizeof(*s->chstats), outlink->ch_layout.nb_channels);
s->chstats = av_calloc(outlink->ch_layout.nb_channels, sizeof(*s->chstats));
if (!s->chstats)
return AVERROR(ENOMEM);

View File

@@ -176,7 +176,7 @@ static int config_input(AVFilterLink *inlink)
sizeof(*s->nb_null_samples));
if (!s->nb_null_samples)
return AVERROR(ENOMEM);
s->start = av_malloc_array(sizeof(*s->start), s->independent_channels);
s->start = av_malloc_array(s->independent_channels, sizeof(*s->start));
if (!s->start)
return AVERROR(ENOMEM);
for (c = 0; c < s->independent_channels; c++)

View File

@@ -688,7 +688,7 @@ AVFilterFormats *ff_all_alpha_modes(void)
if (!f) \
return AVERROR(ENOMEM); \
\
tmp = av_realloc_array(f->refs, sizeof(*f->refs), f->refcount + 1); \
tmp = av_realloc_array(f->refs, f->refcount + 1, sizeof(*f->refs)); \
if (!tmp) { \
unref_fn(&f); \
return AVERROR(ENOMEM); \

View File

@@ -165,7 +165,7 @@ static int read_shape_from_file(int *cols, int *rows, int **values, const char *
ret = AVERROR_INVALIDDATA;
goto end;
}
if (!(*values = av_calloc(sizeof(int) * *rows, *cols))) {
if (!(*values = av_calloc(*cols, sizeof(**values) * *rows))) {
ret = AVERROR(ENOMEM);
goto end;
}

View File

@@ -48,7 +48,7 @@ static int config_props(AVFilterLink *inlink)
priv->pix_desc = av_pix_fmt_desc_get(inlink->format);
av_freep(&priv->line);
if (!(priv->line = av_malloc_array(sizeof(*priv->line), inlink->w)))
if (!(priv->line = av_malloc_array(inlink->w, sizeof(*priv->line))))
return AVERROR(ENOMEM);
return 0;