From be1fd471be362eff1d6e05bef8b8469655174b16 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 21 Dec 2015 01:49:41 +0100 Subject: [PATCH] LAB: better fix of loadMapData, taking into account the other loops on _maps --- engines/lab/map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index 63e3571b8f1..db0ba206fe8 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -87,8 +87,8 @@ void LabEngine::loadMapData() { _music->stopSoundEffect(); _maxRooms = mapFile->readUint16LE(); - _maps = new MapData[_maxRooms]; // will be freed when the user exits the map - for (int i = 0; i < _maxRooms; i++) { + _maps = new MapData[_maxRooms + 1]; // will be freed when the user exits the map + for (int i = 1; i <= _maxRooms; i++) { _maps[i]._x = mapFile->readUint16LE(); _maps[i]._y = mapFile->readUint16LE(); _maps[i]._pageNumber = mapFile->readUint16LE();