diff options
author | Greg Frieger | 2009-03-07 14:40:58 +0000 |
---|---|---|
committer | Greg Frieger | 2009-03-07 14:40:58 +0000 |
commit | 309fb5f60be43f59553de2f6960484c5089e729a (patch) | |
tree | bad12e812768d93f44db22c36a02d1db84373dce /engines/sci | |
parent | 7a88744b749e45efa8fb7339cf0989c5572f3863 (diff) | |
download | scummvm-rg350-309fb5f60be43f59553de2f6960484c5089e729a.tar.gz scummvm-rg350-309fb5f60be43f59553de2f6960484c5089e729a.tar.bz2 scummvm-rg350-309fb5f60be43f59553de2f6960484c5089e729a.zip |
Fixed crash when reading some SCI1 resource map
svn-id: r39185
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/scicore/resource.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp index ebe690dce9..cfb7eeaa96 100644 --- a/engines/sci/scicore/resource.cpp +++ b/engines/sci/scicore/resource.cpp @@ -916,8 +916,8 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map, ResourceSource *vo if (!file.open(map->location_name)) return SCI_ERROR_RESMAP_NOT_FOUND; - resource_index_t resMap[kResourceTypeInvalid]; - memset(resMap, 0, sizeof(resource_index_t) * kResourceTypeInvalid); + resource_index_t resMap[32]; + memset(resMap, 0, sizeof(resource_index_t) * 32); byte type = 0, prevtype = 0; byte nEntrySize = _mapVersion == SCI_VERSION_1_1 ? SCI11_RESMAP_ENTRIES_SIZE : SCI1_RESMAP_ENTRIES_SIZE; uint32 resId; @@ -934,7 +934,7 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map, ResourceSource *vo // reading each type's offsets uint32 off = 0; - for (type = 0; type < kResourceTypeInvalid; type++) { + for (type = 0; type < 32; type++) { if (resMap[type].wOffset == 0) // this resource does not exist in map continue; file.seek(resMap[type].wOffset); |