aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/resource_audio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/resource_audio.cpp')
-rw-r--r--engines/sci/resource_audio.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 7423890903..c70a2a2322 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -430,8 +430,20 @@ int ResourceManager::readAudioMapSCI11(IntMapResourceSource *map) {
}
}
+ const ResourceId id = ResourceId(kResourceTypeAudio36, map->_mapNumber, n & 0xffffff3f);
+
+ // At least version 1.00 of GK2 has multiple invalid audio36 map
+ // entries on CD 6
+ if (g_sci->getGameId() == GID_GK2 &&
+ map->_volumeNumber == 6 &&
+ offset + syncSize >= srcSize) {
+
+ debugC(kDebugLevelResMan, "Invalid offset %u for %s in map %d for disc %d", offset + syncSize, id.toPatchNameBase36().c_str(), map->_mapNumber, map->_volumeNumber);
+ continue;
+ }
+
assert(offset + syncSize < srcSize);
- addResource(ResourceId(kResourceTypeAudio36, map->_mapNumber, n & 0xffffff3f), src, offset + syncSize);
+ addResource(id, src, offset + syncSize);
}
}