avfilter/af_alimiter: check if buffer_size is valid

Fixes #7050.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/281/head
Paul B Mahol 7 years ago
parent 1b1362e408
commit ea0963181a
  1. 5
      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;
}

Loading…
Cancel
Save