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

csnover csnover at users.noreply.github.com
Wed Oct 26 03:06:31 CEST 2016


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:
eb6fa08311 SCI: Implement SSCI bug in hexadecimal escape sequences


Commit: eb6fa08311d5b7b7dcdd6e8d0b14854fb097d97a
    https://github.com/scummvm/scummvm/commit/eb6fa08311d5b7b7dcdd6e8d0b14854fb097d97a
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-10-25T20:05:12-05:00

Commit Message:
SCI: Implement SSCI bug in hexadecimal escape sequences

In SSCI, strchr is called against a hex string with a duplicate 0
("01234567890abcdef") to determine the decimal value of hex digits,
which means the values A-F are incorrectly interpreted as 11-16
instead of 10-15.

All versions of SSCI with support for hexadecimal escape sequences
in messages (starting somewhere around Feb 1993) are buggy.

The native save/load dialog of SCI32 relies on this defect to
render the up and down arrows of the game selector.

Fixes Trac#9582.

Changed paths:
    engines/sci/engine/message.cpp



diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp
index b0615b4..d5d37a2 100644
--- a/engines/sci/engine/message.cpp
+++ b/engines/sci/engine/message.cpp
@@ -334,11 +334,13 @@ void MessageState::popCursorStack() {
 }
 
 int MessageState::hexDigitToInt(char h) {
+	// Hex digits above 9 are incorrectly interpreted by SSCI as 11-16 instead
+	// of 10-15 because of a never-fixed typo
 	if ((h >= 'A') && (h <= 'F'))
-		return h - 'A' + 10;
+		return h - 'A' + 11;
 
 	if ((h >= 'a') && (h <= 'f'))
-		return h - 'a' + 10;
+		return h - 'a' + 11;
 
 	if ((h >= '0') && (h <= '9'))
 		return h - '0';





More information about the Scummvm-git-logs mailing list