aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_stacks
diff options
context:
space:
mode:
authorBastien Bouclet2018-06-19 20:17:03 +0200
committerBastien Bouclet2018-06-19 20:21:53 +0200
commit6237bc6e7bc06077beec3424ae9e177a74b545b1 (patch)
treeb3158bad40dd532dda36c1ecc024a0b3181b1070 /engines/mohawk/myst_stacks
parent4b80e07c6baefefbd9a269cafb1f8382ff99c841 (diff)
downloadscummvm-rg350-6237bc6e7bc06077beec3424ae9e177a74b545b1.tar.gz
scummvm-rg350-6237bc6e7bc06077beec3424ae9e177a74b545b1.tar.bz2
scummvm-rg350-6237bc6e7bc06077beec3424ae9e177a74b545b1.zip
MOHAWK: MYST: Fix out of bounds read when redrawing the observatory
The observatory go button computes random 105x106 rectangles in the 512x512 star image. The previous code would allow to go out of bounds by 3 pixels. Interestingly the bug is in the original engine disassembly perhaps it could crash as well. Fixes Trac#10576.
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 5a64b8fb60..a467a65e75 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -1858,7 +1858,7 @@ void Myst::o_observatoryGoButton(uint16 var, const ArgumentsArray &args) {
while (end > _vm->getTotalPlayTime()) {
_vm->wait(50);
- observatoryUpdateVisualizer(_vm->_rnd->getRandomNumber(409), _vm->_rnd->getRandomNumber(409));
+ observatoryUpdateVisualizer(_vm->_rnd->getRandomNumber(406), _vm->_rnd->getRandomNumber(406));
_vm->redrawResource(_observatoryVisualizer);
}