[Scummvm-cvs-logs] SF.net SVN: scummvm:[47563] scummvm/trunk/engines/sci/engine/kscripts.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jan 26 12:25:19 CET 2010


Revision: 47563
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47563&view=rev
Author:   thebluegr
Date:     2010-01-26 11:25:15 +0000 (Tue, 26 Jan 2010)

Log Message:
-----------
Ignore kUnload calls which are not made with less than 2 parameters. Apparently, according to the FreeSCI bugs list, SQ1 calls it with 1 parameter when exiting the Ulence flats bar

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kscripts.cpp

Modified: scummvm/trunk/engines/sci/engine/kscripts.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kscripts.cpp	2010-01-26 08:31:27 UTC (rev 47562)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp	2010-01-26 11:25:15 UTC (rev 47563)
@@ -73,12 +73,19 @@
 
 // Unloads an arbitrary resource of type 'restype' with resource numbber 'resnr'
 reg_t kUnLoad(EngineState *s, int argc, reg_t *argv) {
-	int restype = argv[0].toUint16();
-	reg_t resnr = argv[1];
+	if (argc >= 2) {
+		int restype = argv[0].toUint16();
+		reg_t resnr = argv[1];
 
-	if (restype == kResourceTypeMemory)
-		kfree(s->_segMan, resnr);
+		if (restype == kResourceTypeMemory)
+			kfree(s->_segMan, resnr);
 
+		if (argc > 2)
+			warning("kUnload called with more than 2 parameters (%d)", argc);
+	} else {
+		warning("kUnload called with %d arguments - ignoring", argc);
+	}
+
 	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