From d9ed0f0d2e0559461e5fdb1e18ac28adf3fea684 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 29 Nov 2022 09:34:51 -0700 Subject: [PATCH] temporal: use muldiv_round to avoid overflow in TempoMetric::superclocks_per_grid() --- libs/temporal/temporal/tempo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/temporal/temporal/tempo.h b/libs/temporal/temporal/tempo.h index 65bb96289f..0eae4d3a85 100644 --- a/libs/temporal/temporal/tempo.h +++ b/libs/temporal/temporal/tempo.h @@ -503,7 +503,7 @@ class LIBTEMPORAL_API TempoMetric return superclocks_per_grid () * _meter->divisions_per_bar(); } superclock_t superclocks_per_grid () const { - return int_div_round (_tempo->superclocks_per_note_type() * _tempo->note_type(), (int64_t) _meter->note_value()); + return PBD::muldiv_round (_tempo->superclocks_per_note_type(), _tempo->note_type(), (int64_t) _meter->note_value()); } superclock_t superclocks_per_note_type_at_superclock (superclock_t sc) const {