diff options
author | wm4 <wm4@nowhere> | 2020-06-02 19:24:04 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-06-02 20:43:49 +0200 |
commit | 0edeb0899a154a57a24e02d487e47bae648e8eff (patch) | |
tree | 956b56ebab7450b463e3457814317128644da4a4 /audio/filter/af_scaletempo.c | |
parent | 376aea36ebffeb29a8c397e667acdcd83f9f659f (diff) | |
download | mpv-0edeb0899a154a57a24e02d487e47bae648e8eff.tar.bz2 mpv-0edeb0899a154a57a24e02d487e47bae648e8eff.tar.xz |
af_scaletempo: handle obscure integer overflow
Saw it once, not really reproducible. This should fix it, and in any
case it's harmless.
Diffstat (limited to 'audio/filter/af_scaletempo.c')
-rw-r--r-- | audio/filter/af_scaletempo.c | 8 |
1 files 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) { |