[Scummvm-git-logs] scummvm master -> 58a32cddecc176a4b0e4709fa2ef98a3cd9c0887

eriktorbjorn eriktorbjorn at telia.com
Sun Nov 6 10:50:10 CET 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:
58a32cddec ADL - Fix overflow causing infinite loop in word-wrapping (bug #9628)


Commit: 58a32cddecc176a4b0e4709fa2ef98a3cd9c0887
    https://github.com/scummvm/scummvm/commit/58a32cddecc176a4b0e4709fa2ef98a3cd9c0887
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2016-11-06T10:48:22+01:00

Commit Message:
ADL - Fix overflow causing infinite loop in word-wrapping (bug #9628)

When the text to word-wrap was longer than 255 characters, the
'pos' and 'endPos' counters would overflow, causing it to never
reach the end of the string to word-wrap.

Changed paths:
    engines/adl/adl_v2.cpp



diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp
index 979d794..454e4ac 100644
--- a/engines/adl/adl_v2.cpp
+++ b/engines/adl/adl_v2.cpp
@@ -182,8 +182,8 @@ Common::String AdlEngine_v2::loadMessage(uint idx) const {
 
 void AdlEngine_v2::printString(const Common::String &str) {
 	Common::String s(str);
-	byte endPos = TEXT_WIDTH - 1;
-	byte pos = 0;
+	int endPos = TEXT_WIDTH - 1;
+	int pos = 0;
 
 	while (true) {
 		while (pos <= endPos && pos != s.size()) {





More information about the Scummvm-git-logs mailing list