aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/draw_v2.cpp
diff options
context:
space:
mode:
authorSven Hesse2011-01-26 19:03:13 +0000
committerSven Hesse2011-01-26 19:03:13 +0000
commita2afc0f4d19f8eff5e9ebc49d51035970d4bcb8c (patch)
tree7127d56d027982fbc88a36b19e8397ea63a20f2c /engines/gob/draw_v2.cpp
parent2c2476b203c10699973950f08f6d8a4b3866408e (diff)
downloadscummvm-rg350-a2afc0f4d19f8eff5e9ebc49d51035970d4bcb8c.tar.gz
scummvm-rg350-a2afc0f4d19f8eff5e9ebc49d51035970d4bcb8c.tar.bz2
scummvm-rg350-a2afc0f4d19f8eff5e9ebc49d51035970d4bcb8c.zip
GOB: Check font index for kFontCount
svn-id: r55547
Diffstat (limited to 'engines/gob/draw_v2.cpp')
-rw-r--r--engines/gob/draw_v2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index e31b1f8269..ee6f9132aa 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -788,12 +788,12 @@ void Draw_v2::spriteOperation(int16 operation) {
left = _destSpriteX;
if ((_fontIndex >= 4) || (_fontToSprite[_fontIndex].sprite == -1)) {
- Font *font = _fonts[_fontIndex];
- if (!font) {
+ if ((_fontIndex >= kFontCount) || !_fonts[_fontIndex]) {
warning("Trying to print \"%s\" with undefined font %d", _textToPrint, _fontIndex);
break;
}
+ Font *font = _fonts[_fontIndex];
if (font->isMonospaced()) {
if (((int8) _textToPrint[0]) == -1) {
_vm->validateLanguage();