aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-12-20 09:48:19 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-12-29 01:19:06 +0100
commite6459abfadabb43cdc4c807975e1a854da23644d (patch)
treeace64ebb6e9d4a6c61f07a62569024fd463b9c79
parente4d2666bdc3dbd177a81bbf428654a5f2fa3787a (diff)
downloadffmpeg-e6459abfadabb43cdc4c807975e1a854da23644d.tar.gz
avfilter/af_stereotools: round-up max size of buffer
Fixes: out of array access Fixes: tickets/10747/poc14ffmpeg Found-by: Zeng Yunxiang and Song Jiaxuan Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/af_stereotools.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c
index 4bcd696cf9..915edecc53 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)