From: Paul B Mahol <[email protected]>

Fixes: out of array access
Fixes: tickets/10747/poc14ffmpeg

Found-by: Zeng Yunxiang and Song Jiaxuan
Signed-off-by: Michael Niedermayer <[email protected]>
---
 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

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to