From 06962db454c0a73087a06511b70accc69053bba8 Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 15 Apr 2013 21:54:00 +0200 Subject: KYRA: (HOF) - fix possible out of bounds array access --- engines/kyra/sequences_hof.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index e70bbca88b..a4294cbc37 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -1041,7 +1041,8 @@ void SeqPlayer_HOF::playDialogueAnimation(uint16 strID, uint16 soundID, int text int dur = int(strlen(_sequenceStrings[strID])) * (_vm->gameFlags().isTalkie ? 7 : 15); if (_vm->textEnabled()) { int slot = displaySubTitle(strID, textPosX, textPosY, dur, textWidth); - _textSlots[slot].textcolor = textColor; + if (slot >= 0) + _textSlots[slot].textcolor = textColor; } _specialAnimTimeOutTotal = _system->getMillis() + dur * _vm->tickLength(); int curframe = animStartFrame; -- cgit v1.2.3