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>
(cherry picked from commit 50f0f8c53c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-12-23 04:03:01 +01:00
parent 4d9f97ffb1
commit 5715c8ed18
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 2 additions and 0 deletions

View File

@ -75,6 +75,8 @@ static int config_input(AVFilterLink *inlink)
s->length = 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);