aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2013-08-04 09:14:11 +0200
committerTorbjörn Andersson2013-08-04 09:14:11 +0200
commit38071bc5c5d2b2543dc23b38e1b810d791bf4a26 (patch)
tree28d2f8d267ab4a68c6bda04bdb2f12b6f72881f3 /engines
parent68b5de7cd4e1ee335ca710fe0ba44251a7c4b28d (diff)
downloadscummvm-rg350-38071bc5c5d2b2543dc23b38e1b810d791bf4a26.tar.gz
scummvm-rg350-38071bc5c5d2b2543dc23b38e1b810d791bf4a26.tar.bz2
scummvm-rg350-38071bc5c5d2b2543dc23b38e1b810d791bf4a26.zip
MORTEVIELLE: Fix out-of-bounds read
This should be sufficient. At this point, cy is at most 23, and if cx is 41 it's either 23 or less than 20. That means ix is either 46 or less than 43. If it's less than 43, there is no out of bounds access, and now we look at the special case first. This was a Coverity issue, but for some reason I don't see any CID for it.
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/actions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 73d258af6c..361917d53b 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1448,7 +1448,7 @@ void MortevielleEngine::fctDiscuss() {
displayQuestionText(lib[choice], 1);
questionAsked[choice] = ! questionAsked[choice];
}
- if ((_coreVar._availableQuestion[ix] == '*') || (ix == 46)) {
+ if ((ix == 46) || (_coreVar._availableQuestion[ix] == '*')) {
posY = ((ix - 1) % 23) << 3;
if (ix > 23)
posX = 320;