aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2008-05-24 14:54:22 +0000
committerSven Hesse2008-05-24 14:54:22 +0000
commitafa92cf083e8a43a1ff6b9290763327e71ca1551 (patch)
treef13824b1651e9733be449d02c50e0f9b39cccd97 /engines/gob
parent182ae52a98671fcd398446e5ac4ef983f5a17873 (diff)
downloadscummvm-rg350-afa92cf083e8a43a1ff6b9290763327e71ca1551.tar.gz
scummvm-rg350-afa92cf083e8a43a1ff6b9290763327e71ca1551.tar.bz2
scummvm-rg350-afa92cf083e8a43a1ff6b9290763327e71ca1551.zip
Added updateStatic()'s sanity checks to renderStatic() as well.
Fixes an invalid read when entering the red light district svn-id: r32246
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/scenery.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index fa7944c203..2da6b092e0 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -286,6 +286,9 @@ void Scenery::renderStatic(int16 scenery, int16 layer) {
pieceIndex = planePtr->pieceIndex;
pictIndex = planePtr->pictIndex - 1;
+ if ((pictIndex >= _staticPictCount[scenery]) || (!ptr->pieces))
+ continue;
+
_vm->_draw->_destSpriteX = planePtr->destX;
_vm->_draw->_destSpriteY = planePtr->destY;
left = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].left);