From 38e71d8b6c55f56ef58f1acb1c8d9e12a65e0a1d Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 25 Dec 2020 14:01:52 +0100 Subject: avfilter/af_tremolo: make sure table size is at least 1 --- libavfilter/af_tremolo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavfilter/af_tremolo.c') 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); -- cgit v1.2.3