Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Feb 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions engines/sci/resource.cpp
Expand Up @@ -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);
};
}


Expand Down Expand Up @@ -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

Expand Down