aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-10-06 14:47:30 +0200
committerWillem Jan Palenstijn2013-10-06 14:47:30 +0200
commitb7f7644cc64afaa5c470e663fbd9387564856e88 (patch)
tree32dfeb966896f0f86af596fa0faddb146c966d5d /engines
parent6216430428724e8d833736d00cb807b14507bd9c (diff)
downloadscummvm-rg350-b7f7644cc64afaa5c470e663fbd9387564856e88.tar.gz
scummvm-rg350-b7f7644cc64afaa5c470e663fbd9387564856e88.tar.bz2
scummvm-rg350-b7f7644cc64afaa5c470e663fbd9387564856e88.zip
AVALANCHE: Fix potential integer overflow
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/parser.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 98deefae4e..a9f9ea2be4 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -534,11 +534,10 @@ Common::String Parser::rank() {
Common::String Parser::totalTime() {
uint16 h, m, s;
- h = (uint16)((_vm->_totalTime * 3600) / 65535);
- m = h % 3600;
- h /= 3600;
- s = m % 60;
- m /= 60;
+ h = (uint16)(_vm->_totalTime / 65535);
+ s = (uint16)(_vm->_totalTime % 65535);
+ m = s / 60;
+ s = s % 60;
Common::String result = "You've been playing for ";
if (h > 0)