mirror of https://github.com/mpv-player/mpv
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:
parent
376aea36eb
commit
0edeb0899a
|
@ -187,10 +187,10 @@ static int best_overlap_offset_s16(struct priv *s)
|
||||||
ps += s->samples_overlap - s->num_channels;
|
ps += s->samples_overlap - s->num_channels;
|
||||||
long i = -(s->samples_overlap - s->num_channels);
|
long i = -(s->samples_overlap - s->num_channels);
|
||||||
do {
|
do {
|
||||||
corr += ppc[i + 0] * ps[i + 0];
|
corr += ppc[i + 0] * (int64_t)ps[i + 0];
|
||||||
corr += ppc[i + 1] * ps[i + 1];
|
corr += ppc[i + 1] * (int64_t)ps[i + 1];
|
||||||
corr += ppc[i + 2] * ps[i + 2];
|
corr += ppc[i + 2] * (int64_t)ps[i + 2];
|
||||||
corr += ppc[i + 3] * ps[i + 3];
|
corr += ppc[i + 3] * (int64_t)ps[i + 3];
|
||||||
i += 4;
|
i += 4;
|
||||||
} while (i < 0);
|
} while (i < 0);
|
||||||
if (corr > best_corr) {
|
if (corr > best_corr) {
|
||||||
|
|
Loading…
Reference in New Issue