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

sev- noreply at scummvm.org
Sun Jun 22 21:00:13 UTC 2025


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

Summary:
dd4117d1d9 DIRECTOR: Fix crash in fallback detectiom, improvements


Commit: dd4117d1d9b2f6a703e8d6a39b2b6453ef370297
    https://github.com/scummvm/scummvm/commit/dd4117d1d9b2f6a703e8d6a39b2b6453ef370297
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-06-22T22:58:50+02:00

Commit Message:
DIRECTOR: Fix crash in fallback detectiom, improvements

Do not put version number with blacklisted (untouched) names.
Also, do not use internal name as a potential game name

Changed paths:
    engines/director/detection.cpp


diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index c0a1d5f315d..59b83bf12a3 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -137,6 +137,7 @@ static Director::DirectorGameDescription s_fallbackDesc = {
 	0
 };
 
+static char s_fallbacGameIdBuffer[256];
 static char s_fallbackFileNameBuffer[51];
 static char s_fallbackExtraBuf[256];
 
@@ -289,30 +290,29 @@ ADDetectedGame DirectorMetaEngineDetection::fallbackDetect(const FileMap &allFil
 			if (versionInfo) {
 				Common::String internalName = versionInfo->hash["InternalName"].encode();
 				Common::String fileDescription = versionInfo->hash["FileDescription"].encode();
-				if (!_fallback_blacklisted_names.contains(internalName)) {
-					if (extraInfo != nullptr) {
-						*extraInfo = new ADDetectedGameExtraInfo;
-						(*extraInfo)->gameName = internalName;
 
-						sanitizedName = AdvancedMetaEngineDetectionBase::sanitizeName(fileDescription.c_str(), fileDescription.size());
-						desc->desc.gameId = sanitizedName.c_str();
-					}
-				} else if (!_fallback_blacklisted_names.contains(fileDescription)) {
+				warning("Director fallback detection int name: %s", internalName.c_str());
+				warning("Director fallback detection file name: %s", fileDescription.c_str());
+				warning("Director fallback detection version: v%d.%d.%dr%d", versionInfo->fileVersion[0], versionInfo->fileVersion[1], versionInfo->fileVersion[2], versionInfo->fileVersion[3]);
+
+				if (!_fallback_blacklisted_names.contains(fileDescription)) {
 					if (extraInfo != nullptr) {
 						*extraInfo = new ADDetectedGameExtraInfo;
 						(*extraInfo)->gameName = fileDescription;
 
 						sanitizedName = AdvancedMetaEngineDetectionBase::sanitizeName(fileDescription.c_str(), fileDescription.size());
-						desc->desc.gameId = sanitizedName.c_str();
+						Common::strlcpy(s_fallbacGameIdBuffer, sanitizedName.c_str(), sizeof(s_fallbacGameIdBuffer) - 1);
+						desc->desc.gameId = s_fallbacGameIdBuffer;
+
+						extra = Common::String::format("v%d.%d.%dr%d", versionInfo->fileVersion[0], versionInfo->fileVersion[1], versionInfo->fileVersion[2], versionInfo->fileVersion[3]);
 					}
 				}
-				extra = Common::String::format("v%d.%d.%dr%d", versionInfo->fileVersion[0], versionInfo->fileVersion[1], versionInfo->fileVersion[2], versionInfo->fileVersion[3]);
 				delete versionInfo;
 			}
 			delete exe;
 		}
 		if (extra.empty()) {
-			extra = Common::String::format("v%d.%02d", desc->version / 100, desc->version % 100);
+			extra = Common::String::format("D%d.%02d", desc->version / 100, desc->version % 100);
 		}
 		Common::strlcpy(s_fallbackExtraBuf, extra.c_str(), sizeof(s_fallbackExtraBuf) - 1);
 		desc->desc.extra = s_fallbackExtraBuf;




More information about the Scummvm-git-logs mailing list