[Scummvm-git-logs] scummvm master -> 8f5a43290717867e82884e25aabd7c1fb31832ab

sev- sev at scummvm.org
Sun Apr 26 10:04:42 UTC 2020


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:
8f5a432907 GRAPHICS: MACGUI: Fix crash when text is too narrow for a single chunk in MacText


Commit: 8f5a43290717867e82884e25aabd7c1fb31832ab
    https://github.com/scummvm/scummvm/commit/8f5a43290717867e82884e25aabd7c1fb31832ab
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-26T12:04:07+02:00

Commit Message:
GRAPHICS: MACGUI: Fix crash when text is too narrow for a single chunk in MacText

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index bdacd4b84b..2d03c1bda6 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -168,6 +168,13 @@ void MacText::chopChunk(Common::U32String &str) {
 
 	chunk->getFont()->wordWrapText(str, _maxWidth, text, w);
 
+	if (text.size() == 0) {
+		warning("chopChunk: too narrow width, >%d", _maxWidth);
+		chunk->text += str;
+
+		return;
+	}
+
 	chunk->text += text[0];
 
 	D(9, "** splitString, subchunk: \"%s\"", toPrintable(text[0].encode()).c_str());




More information about the Scummvm-git-logs mailing list