avfilter/af_stereowiden: Check length

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

Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.0
Michael Niedermayer 11 months ago
parent ff451df947
commit 50f0f8c53c
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavfilter/af_stereowiden.c

@ -74,6 +74,8 @@ static int config_input(AVFilterLink *inlink)
s->length = lrintf(s->delay * inlink->sample_rate / 1000);
s->length *= 2;
if (s->length == 0)
return AVERROR(EINVAL);
s->buffer = av_calloc(s->length, sizeof(*s->buffer));
if (!s->buffer)
return AVERROR(ENOMEM);

Loading…
Cancel
Save