aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/fonts.cpp2
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/engines/sherlock/fonts.cpp b/engines/sherlock/fonts.cpp
index 9b58eea17c..431159ca81 100644
--- a/engines/sherlock/fonts.cpp
+++ b/engines/sherlock/fonts.cpp
@@ -130,7 +130,7 @@ void Fonts::setFont(int fontNum) {
// Iterate through the frames to find the widest and tallest font characters
_fontHeight = _widestChar = 0;
- for (uint idx = 0; idx < _charCount; ++idx) {
+ for (uint idx = 0; idx < MIN((int)_charCount, 128 - 32); ++idx) {
_fontHeight = MAX((uint16)_fontHeight, (*_font)[idx]._frame.h);
_widestChar = MAX((uint16)_widestChar, (*_font)[idx]._frame.w);
}
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index be2baf9184..b6e9482e3c 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -276,7 +276,7 @@ void ScalpelTalk::talkInterface(const byte *&str) {
str += idx;
// If line wrap occurred, then move to after the separating space between the words
- if ((!isOpcode(str[0])) && str[0] != '{')
+ if (str[0] && (!isOpcode(str[0])) && str[0] != '{')
++str;
_yp += 9;