[FFmpeg-cvslog] avfilter/af_tremolo: make sure table size is at least 1

Paul B Mahol git at videolan.org
Fri Dec 25 15:14:30 EET 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Dec 25 14:01:52 2020 +0100| [38e71d8b6c55f56ef58f1acb1c8d9e12a65e0a1d] | committer: Paul B Mahol

avfilter/af_tremolo: make sure table size is at least 1

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=38e71d8b6c55f56ef58f1acb1c8d9e12a65e0a1d
---

 libavfilter/af_tremolo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);



More information about the ffmpeg-cvslog mailing list