avfilter/af_alimiter: check if buffer_size is valid

Fixes #7050.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2018-03-07 21:36:12 +01:00
parent 1b1362e408
commit ea0963181a
1 changed files with 5 additions and 0 deletions

View 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;
}