aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2007-07-25 21:02:30 +0000
committerSven Hesse2007-07-25 21:02:30 +0000
commite151167dd89a3be0524103c83e49593242a6e66d (patch)
tree081109275dcc3ed82f023f15a7439b425cc7fb32 /engines
parent99a707d89e62ef4a59a58e0e946ae3db9fe804fa (diff)
downloadscummvm-rg350-e151167dd89a3be0524103c83e49593242a6e66d.tar.gz
scummvm-rg350-e151167dd89a3be0524103c83e49593242a6e66d.tar.bz2
scummvm-rg350-e151167dd89a3be0524103c83e49593242a6e66d.zip
Some more safety checks and the first room's background can be seen
svn-id: r28204
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/goblin.cpp3
-rw-r--r--engines/gob/goblin_v3.cpp3
-rw-r--r--engines/gob/inter_v1.cpp4
-rw-r--r--engines/gob/scenery.cpp2
4 files changed, 11 insertions, 1 deletions
diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp
index 418b31e2ee..1db741bd44 100644
--- a/engines/gob/goblin.cpp
+++ b/engines/gob/goblin.cpp
@@ -1698,6 +1698,9 @@ void Goblin::playSounds(Mult::Mult_Object *obj) {
int16 sndSlot;
int16 frame;
+ if (!obj->goblinStates)
+ return;
+
animData = obj->pAnimData;
for (int i = 1; i <= obj->goblinStates[animData->state][0].dataCount; i++) {
diff --git a/engines/gob/goblin_v3.cpp b/engines/gob/goblin_v3.cpp
index 002ef7b749..f4aa872fa1 100644
--- a/engines/gob/goblin_v3.cpp
+++ b/engines/gob/goblin_v3.cpp
@@ -115,6 +115,9 @@ void Goblin_v3::placeObject(Gob_Object *objDesc, char animated,
Mult::Mult_Object &obj = _vm->_mult->_objects[index];
Mult::Mult_AnimData &objAnim = *(obj.pAnimData);
+ if (!obj.goblinStates)
+ return;
+
if ((state != -1) && (obj.goblinStates[state] != 0)) {
if (state == 8)
objAnim.curLookDir = 0;
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index bc7eb2ea11..572f133e33 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -1705,6 +1705,10 @@ bool Inter_v1::o1_capturePush(OpFuncParams &params) {
top = _vm->_parse->parseValExpr();
width = _vm->_parse->parseValExpr();
height = _vm->_parse->parseValExpr();
+
+ if ((width < 0) || (height < 0))
+ return false;
+
_vm->_game->capturePush(left, top, width, height);
(*_vm->_scenery->_pCaptureCounter)++;
return false;
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index ae04c220d3..95cf90bddc 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -320,7 +320,7 @@ void Scenery::updateStatic(int16 orderFrom, byte index, byte layer) {
int16 top;
int16 bottom;
- if (layer >= _statics[index].layersCount)
+ if ((index >= 10) || layer >= _statics[index].layersCount)
return;
layerPtr = &_statics[index].layers[layer];