[Scummvm-git-logs] scummvm master -> d18a4adaa2b947607da73aa4c16d028da0eb89b2
dreammaster
noreply at scummvm.org
Tue May 23 03:35:53 UTC 2023
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:
d18a4adaa2 ULTIMA: ULTIMA6: Fix crash in FM-Towns converse gump
Commit: d18a4adaa2b947607da73aa4c16d028da0eb89b2
https://github.com/scummvm/scummvm/commit/d18a4adaa2b947607da73aa4c16d028da0eb89b2
Author: PushmePullyu (127053144+PushmePullyu at users.noreply.github.com)
Date: 2023-05-22T20:35:22-07:00
Commit Message:
ULTIMA: ULTIMA6: Fix crash in FM-Towns converse gump
MsgScroll::parse_token(): Skip token parsing when length is 0.
Prevents failed assertion when opening a converse gump with
the FM-Towns data files installed and game style set to "new style":
engines/ultima/shared/std/string.h:93:
char& Ultima::Std::string::operator[](size_t):
Assertion `idx < _size' failed.
The call chain is as follows:
ConverseGump::parse_token()
parse_fm_towns_token(token) // <-- this can truncate string token->s
to length 0
MsgScroll::parse_token(token) // <-- token->s[0] is accessed here
without checking length
Changed paths:
engines/ultima/nuvie/gui/widgets/msg_scroll.cpp
diff --git a/engines/ultima/nuvie/gui/widgets/msg_scroll.cpp b/engines/ultima/nuvie/gui/widgets/msg_scroll.cpp
index ef81e4f587d..df52a5416c3 100644
--- a/engines/ultima/nuvie/gui/widgets/msg_scroll.cpp
+++ b/engines/ultima/nuvie/gui/widgets/msg_scroll.cpp
@@ -450,6 +450,9 @@ bool MsgScroll::can_fit_token_on_msgline(MsgLine *msg_line, MsgText *token) {
bool MsgScroll::parse_token(MsgText *token) {
MsgLine *msg_line = NULL;
+ if (!(token && token->s.length()))
+ return true;
+
if (!msg_buf.empty())
msg_line = msg_buf.back(); // retrieve the last line from the scroll buffer.
More information about the Scummvm-git-logs
mailing list