diff options
author | Paul B Mahol <onemda@gmail.com> | 2018-03-07 21:36:12 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-03-07 21:37:01 +0100 |
commit | ea0963181a2cc8e42a0c58da96fb7fed5e857e5b (patch) | |
tree | 3c5eaff31cbdf0185ea8fc5a11d0227bd46942e0 /libavfilter/af_alimiter.c | |
parent | 1b1362e408cd6acb63fef126b814b0d16562aa8e (diff) | |
download | ffmpeg-ea0963181a2cc8e42a0c58da96fb7fed5e857e5b.tar.gz |
avfilter/af_alimiter: check if buffer_size is valid
Fixes #7050.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_alimiter.c')
-rw-r--r-- | libavfilter/af_alimiter.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; } |