[Scummvm-cvs-logs] SF.net SVN: scummvm: [29900] scummvm/trunk/engines/lure/surface.cpp
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Tue Dec 18 09:05:19 CET 2007
Revision: 29900
http://scummvm.svn.sourceforge.net/scummvm/?rev=29900&view=rev
Author: dreammaster
Date: 2007-12-18 00:05:19 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
Bugfix for font sizes indexing - dereferencing a character > 128 was giving a negative index
Modified Paths:
--------------
scummvm/trunk/engines/lure/surface.cpp
Modified: scummvm/trunk/engines/lure/surface.cpp
===================================================================
--- scummvm/trunk/engines/lure/surface.cpp 2007-12-18 07:00:42 UTC (rev 29899)
+++ scummvm/trunk/engines/lure/surface.cpp 2007-12-18 08:05:19 UTC (rev 29900)
@@ -316,7 +316,12 @@
uint16 result = 0;
if (numChars == 0) numChars = strlen(s);
- while (numChars-- > 0) result += fontSize[*s++ - ' '] + 2;
+ while (numChars-- > 0) {
+ uint8 charIndex = (uint8)*s++ - 32;
+ assert(charIndex < numFontChars);
+ result += fontSize[charIndex] + 2;
+ }
+
return result;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list