[FFmpeg-devel] [PATCH 4/4] avfilter/af_stereotools: round-up max size of buffer
Michael Niedermayer
michael at niedermayer.cc
Mon Dec 25 01:26:24 EET 2023
From: Paul B Mahol <onemda at gmail.com>
Fixes: out of array access
Fixes: tickets/10747/poc14ffmpeg
Found-by: Zeng Yunxiang and Song Jiaxuan
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavfilter/af_stereotools.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c
index 4bcd696cf90..915edecc539 100644
--- a/libavfilter/af_stereotools.c
+++ b/libavfilter/af_stereotools.c
@@ -119,7 +119,7 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->dst;
StereoToolsContext *s = ctx->priv;
- s->length = FFALIGN(inlink->sample_rate / 10, 2);
+ s->length = FFALIGN((inlink->sample_rate + 9) / 10, 2);
if (!s->buffer)
s->buffer = av_calloc(s->length, sizeof(*s->buffer));
if (!s->buffer)
--
2.17.1
More information about the ffmpeg-devel
mailing list