aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script
diff options
context:
space:
mode:
authorThomas Fach-Pedersen2016-10-24 19:24:32 +0200
committerThomas Fach-Pedersen2016-10-24 19:40:18 +0200
commite0a04a3185d92b0979babdf23a3eaf49c5d815a8 (patch)
tree2357a306f08a0b6e104092f20cd91ac675f4fda5 /engines/bladerunner/script
parent4b6e0f0e7d68e61b5870431d3aded6f7950f2282 (diff)
downloadscummvm-rg350-e0a04a3185d92b0979babdf23a3eaf49c5d815a8.tar.gz
scummvm-rg350-e0a04a3185d92b0979babdf23a3eaf49c5d815a8.tar.bz2
scummvm-rg350-e0a04a3185d92b0979babdf23a3eaf49c5d815a8.zip
BLADERUNNER: Fix out-of-bounds access in voiceover actor (multiple CIDs)
CID 1364219 CID 1364223
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r--engines/bladerunner/script/script.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp
index 060f8778d4..b0bb638440 100644
--- a/engines/bladerunner/script/script.cpp
+++ b/engines/bladerunner/script/script.cpp
@@ -432,11 +432,13 @@ void ScriptBase::Actor_Voice_Over(int sentenceId, int actorId) {
#endif
void ScriptBase::Actor_Voice_Over(int sentenceId, int actorId) {
+ assert(actorId < ACTORS_COUNT);
+
_vm->gameWaitForActive();
_vm->loopActorSpeaking();
_vm->_adq->flush(1, true);
- Actor *actor = (actorId == 99) ? _vm->_voiceoverActor : _vm->_actors[actorId];
+ Actor *actor = _vm->_actors[actorId];
actor->speechPlay(sentenceId, true);
Player_Loses_Control();
@@ -458,7 +460,7 @@ void ScriptBase::Actor_Start_Speech_Sample(int actorId, int sentenceId) {
void ScriptBase::Actor_Start_Voice_Over_Sample(int sentenceId) {
_vm->loopActorSpeaking();
- _vm->_voiceoverActor->speechPlay(sentenceId, true);
+ _vm->_actors[VOICEOVER_ACTOR]->speechPlay(sentenceId, true);
}
int ScriptBase::Actor_Query_Which_Set_In(int actorId) {
@@ -646,11 +648,11 @@ bool ScriptBase::Actor_Clue_Query(int actorId, int clueId) {
}
void ScriptBase::Actor_Clues_Transfer_New_To_Mainframe(int actorId) {
- _vm->_actors[actorId]->copyClues(99);
+ _vm->_actors[actorId]->copyClues(VOICEOVER_ACTOR);
}
void ScriptBase::Actor_Clues_Transfer_New_From_Mainframe(int actorId) {
- _vm->_voiceoverActor->copyClues(actorId);
+ _vm->_actors[VOICEOVER_ACTOR]->copyClues(actorId);
}
void ScriptBase::Actor_Set_Invisible(int actorId, bool isInvisible) {