mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 17:03:13 +00:00
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.
This commit is contained in:
parent
f7d54f2341
commit
a933dc768c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user