SCI: fix segfault upon detection of pirated game, without fallback

This commit is contained in:
Zvika
2020-02-03 09:08:01 +02:00
committed by GitHub
parent d451c6ac51
commit 2f9f488b1e
+9 -3
View File
@@ -420,7 +420,9 @@ void ResourceManager::disposeVolumeFileStream(Common::SeekableReadStream *fileSt
void ResourceManager::loadResource(Resource *res) {
res->_source->loadResource(this, res);
_patcher->applyPatch(*res);
if (_patcher) {
_patcher->applyPatch(*res);
};
}
@@ -980,8 +982,12 @@ void ResourceManager::init() {
#ifdef ENABLE_SCI32
_currentDiscNo = 1;
#endif
_patcher = new ResourcePatcher(g_sci->getGameId(), g_sci->getLanguage());
addSource(_patcher);
if (g_sci) {
_patcher = new ResourcePatcher(g_sci->getGameId(), g_sci->getLanguage());
addSource(_patcher);
} else {
_patcher = NULL;
};
// FIXME: put this in an Init() function, so that we can error out if detection fails completely