[FFmpeg-cvslog] avfilter/af_stereowiden: Check length

Michael Niedermayer git at videolan.org
Sun Apr 14 21:32:31 EEST 2024


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Sat Dec 23 04:03:01 2023 +0100| [76a48e85e4e4c9139a64f7c0bb019d9c088e0ec7] | 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=76a48e85e4e4c9139a64f7c0bb019d9c088e0ec7
---

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

diff --git a/libavfilter/af_stereowiden.c b/libavfilter/af_stereowiden.c
index 251f08438e..8ce2dd02d3 100644
--- a/libavfilter/af_stereowiden.c
+++ b/libavfilter/af_stereowiden.c
@@ -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);



More information about the ffmpeg-cvslog mailing list