aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v1.cpp
diff options
context:
space:
mode:
authorSven Hesse2007-07-25 20:36:14 +0000
committerSven Hesse2007-07-25 20:36:14 +0000
commit99a707d89e62ef4a59a58e0e946ae3db9fe804fa (patch)
treebc51be6e9c5512f65aa24e14e0b86a492413b2d5 /engines/gob/inter_v1.cpp
parentd0780a59549cbbad11ffde3bb165722124c99fa4 (diff)
downloadscummvm-rg350-99a707d89e62ef4a59a58e0e946ae3db9fe804fa.tar.gz
scummvm-rg350-99a707d89e62ef4a59a58e0e946ae3db9fe804fa.tar.bz2
scummvm-rg350-99a707d89e62ef4a59a58e0e946ae3db9fe804fa.zip
Added a few safety checks. Now Woodruff shows the loading image (closely followed by a crash).
svn-id: r28203
Diffstat (limited to 'engines/gob/inter_v1.cpp')
-rw-r--r--engines/gob/inter_v1.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 0339cb7f44..bc7eb2ea11 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -1174,6 +1174,10 @@ bool Inter_v1::o1_loadCursor(OpFuncParams &params) {
id = load16();
index = (int8) *_vm->_global->_inter_execPtr++;
+
+ if ((index * _vm->_draw->_cursorWidth) >= _vm->_draw->_cursorSprites->getWidth())
+ return false;
+
itemPtr = &_vm->_game->_totResourceTable->items[id];
offset = itemPtr->offset;
@@ -1896,6 +1900,10 @@ bool Inter_v1::o1_fillRect(OpFuncParams &params) {
_vm->_draw->_spriteBottom = _vm->_parse->parseValExpr();
_vm->_draw->_backColor = _vm->_parse->parseValExpr();
+
+ if (!_vm->_draw->_spritesArray[_vm->_draw->_destSurface])
+ return false;
+
_vm->_draw->spriteOperation(DRAW_FILLRECT);
return false;
}