af_scaletempo: handle obscure integer overflow

Saw it once, not really reproducible. This should fix it, and in any
case it's harmless.
This commit is contained in:
wm4 2020-06-02 19:24:04 +02:00
parent 376aea36eb
commit 0edeb0899a
1 changed files with 4 additions and 4 deletions

View File

@ -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) {