diff options
author | Sven Hesse | 2008-05-24 14:54:22 +0000 |
---|---|---|
committer | Sven Hesse | 2008-05-24 14:54:22 +0000 |
commit | afa92cf083e8a43a1ff6b9290763327e71ca1551 (patch) | |
tree | f13824b1651e9733be449d02c50e0f9b39cccd97 | |
parent | 182ae52a98671fcd398446e5ac4ef983f5a17873 (diff) | |
download | scummvm-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
-rw-r--r-- | engines/gob/scenery.cpp | 3 |
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); |