[Scummvm-git-logs] scummvm master -> 8408bf1ab165bed9597809620288f3931147467a
bluegr
noreply at scummvm.org
Sun Nov 30 01:35:42 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:
8408bf1ab1 CGE2: Return a default value from getText() when a text can't be found
Commit: 8408bf1ab165bed9597809620288f3931147467a
https://github.com/scummvm/scummvm/commit/8408bf1ab165bed9597809620288f3931147467a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-11-30T03:35: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