From 0edeb0899a154a57a24e02d487e47bae648e8eff Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 2 Jun 2020 19:24:04 +0200 Subject: [PATCH] af_scaletempo: handle obscure integer overflow Saw it once, not really reproducible. This should fix it, and in any case it's harmless. --- audio/filter/af_scaletempo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/audio/filter/af_scaletempo.c b/audio/filter/af_scaletempo.c index b1ee790189..8675c9a50d 100644 --- a/audio/filter/af_scaletempo.c +++ b/audio/filter/af_scaletempo.c @@ -187,10 +187,10 @@ static int best_overlap_offset_s16(struct priv *s) ps += s->samples_overlap - s->num_channels; long i = -(s->samples_overlap - s->num_channels); do { - corr += ppc[i + 0] * ps[i + 0]; - corr += ppc[i + 1] * ps[i + 1]; - corr += ppc[i + 2] * ps[i + 2]; - corr += ppc[i + 3] * ps[i + 3]; + corr += ppc[i + 0] * (int64_t)ps[i + 0]; + corr += ppc[i + 1] * (int64_t)ps[i + 1]; + corr += ppc[i + 2] * (int64_t)ps[i + 2]; + corr += ppc[i + 3] * (int64_t)ps[i + 3]; i += 4; } while (i < 0); if (corr > best_corr) {