aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-05-24 10:51:23 +0200
committerStrangerke2014-05-24 10:51:58 +0200
commite53743ddf9a770e998f348c72ceb4ef6c39fa34b (patch)
tree316c1df899acfdfd91d6b6eeda63def5f2c44dcd
parentd197bb04afa9be420d92b5d927d496ddc881d642 (diff)
downloadscummvm-rg350-e53743ddf9a770e998f348c72ceb4ef6c39fa34b.tar.gz
scummvm-rg350-e53743ddf9a770e998f348c72ceb4ef6c39fa34b.tar.bz2
scummvm-rg350-e53743ddf9a770e998f348c72ceb4ef6c39fa34b.zip
TUCKER: Add a safeguard to avoid a potential out of bound access
-rw-r--r--engines/tucker/tucker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index adf4be6b65..03019bfec5 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -890,9 +890,8 @@ void TuckerEngine::updateCharPosition() {
if (action->_testFlag1Num < 500) {
if (action->_testFlag1Num >= 300)
error("updateCharPosition() - Unexpected value for _testFlag1Num : %d", action->_testFlag1Num);
- if (_flagsTable[action->_testFlag1Num] != action->_testFlag1Value) {
+ if (_flagsTable[action->_testFlag1Num] != action->_testFlag1Value)
skip = false;
- }
} else if (_inventoryItemsState[action->_testFlag1Num - 500] != action->_testFlag1Value) {
skip = false;
}
@@ -900,9 +899,10 @@ void TuckerEngine::updateCharPosition() {
}
if (action->_testFlag2Num != 0) {
if (action->_testFlag2Num < 500) {
- if (_flagsTable[action->_testFlag2Num] != action->_testFlag2Value) {
+ if (action->_testFlag2Num >= 300)
+ error("updateCharPosition() - Unexpected value for _testFlag1Num : %d", action->_testFlag1Num);
+ if (_flagsTable[action->_testFlag2Num] != action->_testFlag2Value)
skip = false;
- }
} else if (_inventoryItemsState[action->_testFlag2Num - 500] != action->_testFlag2Value) {
skip = false;
}