avfilter/af_tremolo: make sure table size is at least 1
This commit is contained in:
parent
676689cc7c
commit
38e71d8b6c
@ -126,7 +126,7 @@ static int config_input(AVFilterLink *inlink)
|
|||||||
const double offset = 1. - s->depth / 2.;
|
const double offset = 1. - s->depth / 2.;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
s->table_size = inlink->sample_rate / s->freq;
|
s->table_size = lrint(inlink->sample_rate / s->freq + 0.5);
|
||||||
s->table = av_malloc_array(s->table_size, sizeof(*s->table));
|
s->table = av_malloc_array(s->table_size, sizeof(*s->table));
|
||||||
if (!s->table)
|
if (!s->table)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user