Browse Source

avfilter/af_alimiter: check if buffer_size is valid

Fixes #7050.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n4.0
Paul B Mahol 8 years ago
parent
commit
ea0963181a
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavfilter/af_alimiter.c

+ 5
- 0
libavfilter/af_alimiter.c 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;
}



Loading…
Cancel
Save