aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authorStrangerke2013-10-25 07:48:46 +0200
committerStrangerke2013-10-25 07:49:51 +0200
commit334e429c0ac0052f11b04e120734aae772e83074 (patch)
tree9d75f657fdb946731b0c007aeaac5c11ea1b9f6d /engines/avalanche
parenta59b4cbc9d1d308121250fa52eeafce8ef763ea9 (diff)
downloadscummvm-rg350-334e429c0ac0052f11b04e120734aae772e83074.tar.gz
scummvm-rg350-334e429c0ac0052f11b04e120734aae772e83074.tar.bz2
scummvm-rg350-334e429c0ac0052f11b04e120734aae772e83074.zip
AVALANCHE: Fix several other out of bounds access - CID 1109650
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/avalot.cpp6
-rw-r--r--engines/avalanche/dialogs.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 072ad00ed6..11729ea779 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -1564,10 +1564,12 @@ Common::String AvalancheEngine::getName(People whose) {
static const char lasses[4][15] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"};
- if (whose < kPeopleArkata)
+ if (whose <= kPeopleJacques)
return Common::String(lads[whose - kPeopleAvalot]);
- else
+ else if ((whose >= kPeopleArkata) && (whose <= kPeopleWisewoman))
return Common::String(lasses[whose - kPeopleArkata]);
+ else
+ error("getName() - Unexpected character id %d", (byte) whose);
}
Common::String AvalancheEngine::getItem(byte which) {
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index e121141a2a..8770e08d60 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -1164,7 +1164,9 @@ void Dialogs::sayThanks(byte thing) {
Common::String tmpStr = personSpeaks();
tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", kControlSpeechBubble);
displayText(tmpStr);
- _vm->_objects[thing] = false;
+
+ if (thing < kObjectNum)
+ _vm->_objects[thing] = false;
}
/**