Commit 94e293a8 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_aphaser: reject too small delay

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 93cc5ca7
......@@ -206,6 +206,10 @@ static int config_output(AVFilterLink *outlink)
AVFilterLink *inlink = outlink->src->inputs[0];
p->delay_buffer_length = p->delay * 0.001 * inlink->sample_rate + 0.5;
if (p->delay_buffer_length <= 0) {
av_log(outlink->src, AV_LOG_ERROR, "delay is too small\n");
return AVERROR(EINVAL);
}
p->delay_buffer = av_calloc(p->delay_buffer_length, sizeof(*p->delay_buffer) * inlink->channels);
p->modulation_buffer_length = inlink->sample_rate / p->speed + 0.5;
p->modulation_buffer = av_malloc_array(p->modulation_buffer_length, sizeof(*p->modulation_buffer));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment