From d1616ea74e1997756c757d33bf4bdf3a4ae7fc5f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 20 Nov 2009 11:08:19 +0000 Subject: Added a sanity check to prevent a crash in LB1 and KQ4 (needs proper fixing) svn-id: r46003 --- engines/sci/gui/gui_menu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/sci') diff --git a/engines/sci/gui/gui_menu.cpp b/engines/sci/gui/gui_menu.cpp index 2406e0ef19..55688ab473 100644 --- a/engines/sci/gui/gui_menu.cpp +++ b/engines/sci/gui/gui_menu.cpp @@ -191,7 +191,8 @@ void SciGuiMenu::add(Common::String title, Common::String content, reg_t content if (rightAlignedPos) { rightAlignedPos++; tempPos = endPos; - if (tagPos) + //if (tagPos) + if (tagPos && tagPos >= rightAlignedPos) // FIXME: sanity check for LB1 and KQ4 tempPos = tagPos; itemEntry->textRightAligned = Common::String(content.c_str() + rightAlignedPos, tempPos - rightAlignedPos); } -- cgit v1.2.3