[FFmpeg-cvslog] avfilter/af_alimiter: check if buffer_size is valid

Paul B Mahol git at videolan.org
Wed Mar 7 22:39:31 EET 2018


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Mar  7 21:36:12 2018 +0100| [ea0963181a2cc8e42a0c58da96fb7fed5e857e5b] | committer: Paul B Mahol

avfilter/af_alimiter: check if buffer_size is valid

Fixes #7050.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavfilter/af_alimiter.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/af_alimiter.c b/libavfilter/af_alimiter.c
index 0fc8e6baa3..c41e95576f 100644
--- a/libavfilter/af_alimiter.c
+++ b/libavfilter/af_alimiter.c
@@ -327,6 +327,11 @@ static int config_input(AVFilterLink *inlink)
     s->buffer_size = inlink->sample_rate * s->attack * inlink->channels;
     s->buffer_size -= s->buffer_size % inlink->channels;
 
+    if (s->buffer_size <= 0) {
+        av_log(ctx, AV_LOG_ERROR, "Attack is too small.\n");
+        return AVERROR(EINVAL);
+    }
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list