From 9feeba7bef8e54bd6782c4acd1e1941015cf46ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Thu, 12 Feb 2015 20:54:58 +0200 Subject: [PATCH] speexdsp: fix integer overflow (probably fixes #5781) --- modules/audio_filter/resampler/speex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/audio_filter/resampler/speex.c b/modules/audio_filter/resampler/speex.c index 774fc8fadd..9b967bfc48 100644 --- a/modules/audio_filter/resampler/speex.c +++ b/modules/audio_filter/resampler/speex.c @@ -22,6 +22,8 @@ # include #endif +#include + #include #include #include @@ -124,7 +126,8 @@ static block_t *Resample (filter_t *filter, block_t *in) const unsigned orate = filter->fmt_out.audio.i_rate; spx_uint32_t ilen = in->i_nb_samples; - spx_uint32_t olen = ((ilen + 2) * orate * 11) / (irate * 10); + spx_uint32_t olen = ((ilen + 2) * orate * UINT64_C(11)) + / (irate * UINT64_C(10)); block_t *out = block_Alloc (olen * framesize); if (unlikely(out == NULL)) -- GitLab