[Scummvm-cvs-logs] SF.net SVN: scummvm:[53498] scummvm/trunk/engines/sci/engine/kgraphics.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Oct 15 16:33:58 CEST 2010
Revision: 53498
http://scummvm.svn.sourceforge.net/scummvm/?rev=53498&view=rev
Author: thebluegr
Date: 2010-10-15 14:33:57 +0000 (Fri, 15 Oct 2010)
Log Message:
-----------
SCI: Fixed access to dest in kTextSize() (thanks LordHoto)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-10-15 14:18:58 UTC (rev 53497)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-10-15 14:33:57 UTC (rev 53498)
@@ -341,6 +341,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)) {
@@ -350,9 +355,8 @@
dest[0] = dest[1] = NULL_REG;
- if (text.empty() || !dest) { // Empty text
- if (dest)
- dest[2] = dest[3] = make_reg(0, 0);
+ if (text.empty()) { // Empty text
+ dest[2] = dest[3] = make_reg(0, 0);
debugC(2, kDebugLevelStrings, "GetTextSize: Empty string");
return s->r_acc;
}
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