summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-10-28 23:02:54 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-28 23:02:54 +0200
commit52aac111699ffbf679b4fc5722be893d41568394 (patch)
treecd413348dd60e5cb8b7f3ae238f0475d58321ad9
parentf8661a47b8ddafb6a076456d4d1b9239aa45e4b1 (diff)
Fix theoretical int overflow.
-rw-r--r--src/lib/dcpomatic_time.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h
index 9e7191b1e..1b12ea901 100644
--- a/src/lib/dcpomatic_time.h
+++ b/src/lib/dcpomatic_time.h
@@ -217,11 +217,11 @@ public:
HMSF hmsf;
hmsf.h = ff / (3600 * r);
- ff -= hmsf.h * 3600 * r;
+ ff -= static_cast<int64_t>(hmsf.h) * 3600 * r;
hmsf.m = ff / (60 * r);
- ff -= hmsf.m * 60 * r;
+ ff -= static_cast<int64_t>(hmsf.m) * 60 * r;
hmsf.s = ff / r;
- ff -= hmsf.s * r;
+ ff -= static_cast<int64_t>(hmsf.s) * r;
hmsf.f = static_cast<int> (ff);
return hmsf;