[Scummvm-git-logs] scummvm master -> 7681edc8c6daa91652f7cdf592d4b9ad9cf1dc41

criezy criezy at scummvm.org
Wed Apr 28 00:48:14 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:
7681edc8c6 AGS: Add sanity check in path mapping in case the file name is empty


Commit: 7681edc8c6daa91652f7cdf592d4b9ad9cf1dc41
    https://github.com/scummvm/scummvm/commit/7681edc8c6daa91652f7cdf592d4b9ad9cf1dc41
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-28T01:47:10+01:00

Commit Message:
AGS: Add sanity check in path mapping in case the file name is empty

Changed paths:
    engines/ags/engine/ac/file.cpp


diff --git a/engines/ags/engine/ac/file.cpp b/engines/ags/engine/ac/file.cpp
index 583dc0da42..6c651de28b 100644
--- a/engines/ags/engine/ac/file.cpp
+++ b/engines/ags/engine/ac/file.cpp
@@ -345,7 +345,7 @@ bool ResolveScriptPath(const String &orig_sc_path, bool read_only, ResolvedPath
 
 	// Sometimes we have multiple consecutive slashes or backslashes.
 	// Remove all of them at the start of the child path.
-	while (child_path[0u] == '\\' || child_path[0u] == '/')
+	while (!child_path.IsEmpty() && (child_path[0u] == '\\' || child_path[0u] == '/'))
 		child_path.ClipLeft(1);
 
 #if AGS_PLATFORM_SCUMMVM




More information about the Scummvm-git-logs mailing list