[Scummvm-git-logs] scummvm master -> a933dc768c584674a2e27b1b7fdbaf62a52c824c

bluegr bluegr at gmail.com
Sat Jul 3 22:20:26 UTC 2021


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:
a933dc768c ILLUSIONS: Fix text handling crash on big-endian systems


Commit: a933dc768c584674a2e27b1b7fdbaf62a52c824c
    https://github.com/scummvm/scummvm/commit/a933dc768c584674a2e27b1b7fdbaf62a52c824c
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2021-07-04T01:20:22+03:00

Commit Message:
ILLUSIONS: Fix text handling crash on big-endian systems

The loop reversing the wide characters on big-endian systems would loop
until _tblPtr, which is way past all TalkEntry text parts, effectively
reversing the string multiple times at incorrect positions.  Thus, some
characters would remain in the incorrect endianness, and the game would
crash.

Trac tickets #11528 and #11236.

Changed paths:
    engines/illusions/resources/talkresource.cpp


diff --git a/engines/illusions/resources/talkresource.cpp b/engines/illusions/resources/talkresource.cpp
index 83ff98a9a7..776f89e15a 100644
--- a/engines/illusions/resources/talkresource.cpp
+++ b/engines/illusions/resources/talkresource.cpp
@@ -52,7 +52,7 @@ void TalkEntry::load(byte *dataStart, Common::SeekableReadStream &stream) {
 		_talkId, textOffs, tblOffs, voiceNameOffs);
 
 #if defined(SCUMM_BIG_ENDIAN)
-	for (byte *ptr = (byte *)_text; ptr != _tblPtr; ptr += 2) {
+	for (byte *ptr = (byte *)_text; *ptr != 0; ptr += 2) {
 		WRITE_UINT16(ptr, SWAP_BYTES_16(READ_UINT16(ptr)));
 	}
 #endif




More information about the Scummvm-git-logs mailing list