[Scummvm-git-logs] scummvm master -> 44dd967a7ee7df2da7e5cc2e19d648b8744f67e6

dreammaster paulfgilbert at gmail.com
Sun Aug 30 01:02:24 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:
44dd967a7e GLK: HUGO: Fix Tales of the Travelling Swordsman crash


Commit: 44dd967a7ee7df2da7e5cc2e19d648b8744f67e6
    https://github.com/scummvm/scummvm/commit/44dd967a7ee7df2da7e5cc2e19d648b8744f67e6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-08-29T18:02:15-07:00

Commit Message:
GLK: HUGO: Fix Tales of the Travelling Swordsman crash

Vanilla hugo limits spaces printed in the GO_TO code block
to the fixed width of a line. But since Glk doesn't have a
predetermined width, when the game specified a width of 7fffh,
it crashed trying to buffer out a string that actual length.
This new fix simply limits spaces to at most 20.

Changed paths:
    engines/glk/hugo/herun.cpp


diff --git a/engines/glk/hugo/herun.cpp b/engines/glk/hugo/herun.cpp
index 7ca30e5fb1..7e0ddd3bca 100644
--- a/engines/glk/hugo/herun.cpp
+++ b/engines/glk/hugo/herun.cpp
@@ -951,7 +951,13 @@ void Hugo::RunPrint() {
 			{
 				codeptr++;
 
-#if !defined (ACTUAL_LINELENGTH)
+#ifdef GLK
+				// WORKAROUND: Glk uses a non-fixed width font for displaying
+				// text, so get the length, but don't allow long runs of spaces
+				if ((a = GetValue()) > 20)
+					a = 0;
+
+#elif !defined (ACTUAL_LINELENGTH)`
 				if ((a = GetValue()) > physical_windowwidth/FIXEDCHARWIDTH)
 					a = physical_windowwidth/FIXEDCHARWIDTH;
 #else




More information about the Scummvm-git-logs mailing list