From 6237bc6e7bc06077beec3424ae9e177a74b545b1 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Tue, 19 Jun 2018 20:17:03 +0200 Subject: 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. --- engines/mohawk/myst_stacks/myst.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') 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); } -- cgit v1.2.3