avfilter/af_alimiter: check if buffer_size is valid
authorPaul B Mahol <onemda@gmail.com>
Wed, 7 Mar 2018 20:36:12 +0000 (21:36 +0100)
committerPaul B Mahol <onemda@gmail.com>
Wed, 7 Mar 2018 20:37:01 +0000 (21:37 +0100)
Fixes #7050.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/af_alimiter.c

index 0fc8e6b..c41e955 100644 (file)
@@ -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;
 }