From afa92cf083e8a43a1ff6b9290763327e71ca1551 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sat, 24 May 2008 14:54:22 +0000 Subject: Added updateStatic()'s sanity checks to renderStatic() as well. Fixes an invalid read when entering the red light district svn-id: r32246 --- engines/gob/scenery.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/gob') 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); -- cgit v1.2.3