[Scummvm-git-logs] scummvm master -> eada3328071fa425638f0a6f76c3d18685195d13

antoniou79 a.antoniou79 at gmail.com
Wed Mar 31 06:41:50 UTC 2021


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:
eada332807 BLADERUNNER: Fix crash when given folder to load legacy save


Commit: eada3328071fa425638f0a6f76c3d18685195d13
    https://github.com/scummvm/scummvm/commit/eada3328071fa425638f0a6f76c3d18685195d13
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2021-03-31T09:39:58+03:00

Commit Message:
BLADERUNNER: Fix crash when given folder to load legacy save

If the debugger load command was given a folder path instead of a path to a file, the game would crash

Also, legacy save (debugger) command should not accept a folder path. The code supports only a full path to a filename. It will not provide an automatically generated name for the legacy save when given a folder -- maybe a tweak to consider for the future, but probably not a thing to bother with.

Changed paths:
    engines/bladerunner/debugger.cpp


diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp
index c202ddba50..e1103b7368 100644
--- a/engines/bladerunner/debugger.cpp
+++ b/engines/bladerunner/debugger.cpp
@@ -1017,6 +1017,11 @@ bool Debugger::cmdLoad(int argc, const char **argv) {
 		return true;
 	}
 
+	if (fs.isDirectory()) {
+		debugPrintf("Warning: Given path %s is a folder. Please provide a path to a file!\n", argv[1]);
+		return true;
+	}
+
 	Common::SeekableReadStream *saveFile = fs.createReadStream();
 
 	_vm->loadGame(*saveFile);
@@ -1040,6 +1045,11 @@ bool Debugger::cmdSave(int argc, const char **argv) {
 		return true;
 	}
 
+	if (fs.isDirectory()) {
+		debugPrintf("Warning: Given path %s is a folder. Please provide a path to a file!\n", argv[1]);
+		return true;
+	}
+
 	Common::WriteStream *saveFile = fs.createWriteStream();
 
 	Graphics::Surface thumbnail = _vm->generateThumbnail();




More information about the Scummvm-git-logs mailing list