[FFmpeg-cvslog] avfilter/af_stereowiden: Check length

Michael Niedermayer git at videolan.org
Sun Apr 14 23:59:23 EEST 2024


ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Sat Dec 23 04:03:01 2023 +0100| [4a8ced17d097765b7d6ee088963b9de34377d546] | committer: Michael Niedermayer

avfilter/af_stereowiden: Check length

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

Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 50f0f8c53c818f73fe2d752708e2fa9d2a2d8a07)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a8ced17d097765b7d6ee088963b9de34377d546
---

 libavfilter/af_stereowiden.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/af_stereowiden.c b/libavfilter/af_stereowiden.c
index 24146ff1df..5925addcbd 100644
--- a/libavfilter/af_stereowiden.c
+++ b/libavfilter/af_stereowiden.c
@@ -74,6 +74,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);



More information about the ffmpeg-cvslog mailing list