diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-12-25 14:01:52 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-12-25 14:12:52 +0100 |
commit | 38e71d8b6c55f56ef58f1acb1c8d9e12a65e0a1d (patch) | |
tree | 37b846e278fc6728dc9353a1810aa972d5b3eb16 /libavfilter/af_tremolo.c | |
parent | 676689cc7c060007854492dac717081211b270d5 (diff) | |
download | ffmpeg-38e71d8b6c55f56ef58f1acb1c8d9e12a65e0a1d.tar.gz |
avfilter/af_tremolo: make sure table size is at least 1
Diffstat (limited to 'libavfilter/af_tremolo.c')
-rw-r--r-- | libavfilter/af_tremolo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/af_tremolo.c b/libavfilter/af_tremolo.c index f55e8e2b09..6baeb7f110 100644 --- a/libavfilter/af_tremolo.c +++ b/libavfilter/af_tremolo.c @@ -126,7 +126,7 @@ static int config_input(AVFilterLink *inlink) const double offset = 1. - s->depth / 2.; 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)); if (!s->table) return AVERROR(ENOMEM); |