[Scummvm-git-logs] scummvm branch-3-0 -> 381b651017e0cc5114ed6a2ca68eece76b2826e5

bluegr noreply at scummvm.org
Sun Nov 30 02:05: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:
381b651017 CGE2: Return a default value from getText() when a text can't be found


Commit: 381b651017e0cc5114ed6a2ca68eece76b2826e5
    https://github.com/scummvm/scummvm/commit/381b651017e0cc5114ed6a2ca68eece76b2826e5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-11-30T04:04:29+02:00

Commit Message:
CGE2: Return a default value from getText() when a text can't be found

Fixes crashing when text entries are missing - bug #14645.
Now, a default value is returned in such cases (the first entry in the
cache, which is a long line of underscores), which is preferable
instead of crashing later on with invalid text references.

Changed paths:
    engines/cge2/text.cpp


diff --git a/engines/cge2/text.cpp b/engines/cge2/text.cpp
index e0edbc6fc9d..0a26384e7f7 100644
--- a/engines/cge2/text.cpp
+++ b/engines/cge2/text.cpp
@@ -129,7 +129,7 @@ char *Text::getText(int ref) {
 		return _cache[i]._text;
 
 	warning("getText: Unable to find ref %d:%d", ref / 256, ref % 256);
-	return nullptr;
+	return _cache[0]._text;
 }
 
 void Text::say(const char *text, Sprite *spr) {




More information about the Scummvm-git-logs mailing list