Skip to content

Commit

Permalink
avfilter/af_stereowiden: Check length
Browse files Browse the repository at this point in the history
Fixes: out of array access
Fixes: tickets/10746/poc13ffmpeg

Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed Dec 29, 2023
1 parent ff451df commit 50f0f8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavfilter/af_stereowiden.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 50f0f8c

Please sign in to comment.