avfilter/af_stereowiden: Check length

Fixes: out of array access
Fixes: tickets/10746/poc13ffmpeg

Found-by: Zeng Yunxiang
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent ff451df9
...@@ -74,6 +74,8 @@ static int config_input(AVFilterLink *inlink) ...@@ -74,6 +74,8 @@ static int config_input(AVFilterLink *inlink)
s->length = lrintf(s->delay * inlink->sample_rate / 1000); s->length = lrintf(s->delay * inlink->sample_rate / 1000);
s->length *= 2; s->length *= 2;
if (s->length == 0)
return AVERROR(EINVAL);
s->buffer = av_calloc(s->length, sizeof(*s->buffer)); s->buffer = av_calloc(s->length, sizeof(*s->buffer));
if (!s->buffer) if (!s->buffer)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
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