aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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];