projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f8661a4
)
Fix theoretical int overflow.
author
Carl Hetherington
<cth@carlh.net>
Sat, 28 Oct 2023 21:02:54 +0000
(23:02 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Sat, 28 Oct 2023 21:02:54 +0000
(23:02 +0200)
src/lib/dcpomatic_time.h
patch
|
blob
|
history
diff --git
a/src/lib/dcpomatic_time.h
b/src/lib/dcpomatic_time.h
index 9e7191b1eb7dc239a890aebc2d6efa5fe81d3f75..1b12ea901653ead8afd3f935679eaea8ecf6e57a 100644
(file)
--- 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;