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

sev- noreply at scummvm.org
Mon Mar 2 17:49:39 UTC 2026


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:
c9e94a9d74 COMMON: Fix out-of-bounds for .po files with missing translations


Commit: c9e94a9d7417119c94f4a3b21f4284c3dda926e2
    https://github.com/scummvm/scummvm/commit/c9e94a9d7417119c94f4a3b21f4284c3dda926e2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-03-02T18:48:56+01:00

Commit Message:
COMMON: Fix out-of-bounds for .po files with missing translations

Changed paths:
    common/translation.cpp


diff --git a/common/translation.cpp b/common/translation.cpp
index 5d246b6a6a2..4a9e8aa909f 100644
--- a/common/translation.cpp
+++ b/common/translation.cpp
@@ -126,7 +126,7 @@ U32String TranslationManager::getPoTranslation(const char *message) const {
 
 	int messageIndex = _poTranslations.getValOrDefault(message, -1);
 
-	if (messageIndex == -1)
+	if (messageIndex == -1 || messageIndex >= (int)_currentTranslationMessages.size())
 		return U32String(message);
 
 	return _currentTranslationMessages[messageIndex].msgstr.decode();
@@ -144,7 +144,7 @@ U32String TranslationManager::getPoTranslation(const char *message, const char *
 
 	int messageIndex = _poTranslations.getValOrDefault(key.c_str(), -1);
 
-	if (messageIndex == -1)
+	if (messageIndex == -1 || messageIndex >= (int)_currentTranslationMessages.size())
 		return U32String(message);
 
 	return _currentTranslationMessages[messageIndex].msgstr.decode();




More information about the Scummvm-git-logs mailing list