[Scummvm-git-logs] scummvm master -> 2f9f488b1e809197ad901fc4e1fbd4e8fb40441d

bluegr bluegr at gmail.com
Mon Feb 3 07:08:05 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

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


Commit: 2f9f488b1e809197ad901fc4e1fbd4e8fb40441d
    https://github.com/scummvm/scummvm/commit/2f9f488b1e809197ad901fc4e1fbd4e8fb40441d
Author: Zvika (haramaty.zvika at gmail.com)
Date: 2020-02-03T09:08:01+02:00

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

Changed paths:
    engines/sci/resource.cpp


diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 3e1f520..5635efb 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -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
 




More information about the Scummvm-git-logs mailing list