[Scummvm-cvs-logs] SF.net SVN: scummvm:[53816] scummvm/branches/branch-1-2-0/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Mon Oct 25 12:58:00 CEST 2010
Revision: 53816
http://scummvm.svn.sourceforge.net/scummvm/?rev=53816&view=rev
Author: thebluegr
Date: 2010-10-25 10:57:59 +0000 (Mon, 25 Oct 2010)
Log Message:
-----------
SCI: Backported revisions 53482, 53498 and 53504 (code bugs from bug #3087872 - "SCI: Code analysis warnings")
Modified Paths:
--------------
scummvm/branches/branch-1-2-0/engines/sci/engine/kgraphics.cpp
scummvm/branches/branch-1-2-0/engines/sci/engine/kpathing.cpp
scummvm/branches/branch-1-2-0/engines/sci/graphics/font.cpp
Modified: scummvm/branches/branch-1-2-0/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/engine/kgraphics.cpp 2010-10-25 10:47:43 UTC (rev 53815)
+++ scummvm/branches/branch-1-2-0/engines/sci/engine/kgraphics.cpp 2010-10-25 10:57:59 UTC (rev 53816)
@@ -347,6 +347,11 @@
int maxwidth = (argc > 3) ? argv[3].toUint16() : 0;
int font_nr = argv[2].toUint16();
+ if (!dest) {
+ debugC(2, kDebugLevelStrings, "GetTextSize: Empty destination");
+ return s->r_acc;
+ }
+
Common::String sep_str;
const char *sep = NULL;
if ((argc > 4) && (argv[4].segment)) {
@@ -356,7 +361,7 @@
dest[0] = dest[1] = NULL_REG;
- if (text.empty() || !dest) { // Empty text
+ if (text.empty()) { // Empty text
dest[2] = dest[3] = make_reg(0, 0);
debugC(2, kDebugLevelStrings, "GetTextSize: Empty string");
return s->r_acc;
Modified: scummvm/branches/branch-1-2-0/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/engine/kpathing.cpp 2010-10-25 10:47:43 UTC (rev 53815)
+++ scummvm/branches/branch-1-2-0/engines/sci/engine/kpathing.cpp 2010-10-25 10:57:59 UTC (rev 53816)
@@ -1311,6 +1311,8 @@
}
}
+ assert(vertex_min != 0); // the vertex cost should never be bigger than HUGE_DISTANCE
+
// Check if we are done
if (vertex_min == s->vertex_end)
break;
Modified: scummvm/branches/branch-1-2-0/engines/sci/graphics/font.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/graphics/font.cpp 2010-10-25 10:47:43 UTC (rev 53815)
+++ scummvm/branches/branch-1-2-0/engines/sci/graphics/font.cpp 2010-10-25 10:57:59 UTC (rev 53816)
@@ -88,7 +88,7 @@
byte *pIn = getCharData(chr);
for (int i = 0; i < charHeight; i++, y++) {
if (greyedOutput)
- mask = greyedTop++ % 2 ? 0xAA : 0x55;
+ mask = ((greyedTop++) % 2) ? 0xAA : 0x55;
for (int done = 0; done < charWidth; done++) {
if ((done & 7) == 0) // fetching next data byte
b = *(pIn++) & mask;
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