aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-16 19:33:28 +0000
committerMartin Kiewitz2010-07-16 19:33:28 +0000
commit564b68a9fc85ed5d7ec6c374a0bc604051744e5a (patch)
treecef7f8f7303e548e9c2fb8e238f8367345a1741a
parent60363b8a53be77e56b23bca87926d07d3dc56ff5 (diff)
downloadscummvm-rg350-564b68a9fc85ed5d7ec6c374a0bc604051744e5a.tar.gz
scummvm-rg350-564b68a9fc85ed5d7ec6c374a0bc604051744e5a.tar.bz2
scummvm-rg350-564b68a9fc85ed5d7ec6c374a0bc604051744e5a.zip
SCI: adding fixme and error() to fix crash when trying to run unmodified gk2
svn-id: r50939
-rw-r--r--engines/sci/resource.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 2958ca1e3b..1a40cba97e 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1396,7 +1396,13 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) {
// for SCI2.1 and SCI3 maps that are not resmap.000. The resmap.* files' numbers
// need to be used in concurrence with the volume specified in the map to get
// the actual resource file.
- addResource(resId, findVolume(map, volume_nr + map->_volumeNumber), off);
+ int mapVolumeNr = volume_nr + map->_volumeNumber;
+ ResourceSource *source = findVolume(map, mapVolumeNr);
+ // FIXME: this code has serious issues with multiple RESMAP.* files (like in unmodified gk2)
+ // adding a resource with source == NULL would crash later on
+ if (!source)
+ error("Unable to find volume for map %s volumeNr %d", map->getLocationName().c_str(), mapVolumeNr);
+ addResource(resId, source, off);
}
}
}