[Scummvm-cvs-logs] CVS: scummvm/scumm script_v72he.cpp,2.148,2.149

Travis Howell kirben at users.sourceforge.net
Sun Oct 3 07:32:09 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3757/scumm

Modified Files:
	script_v72he.cpp 
Log Message:

Add safety check.


Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.148
retrieving revision 2.149
diff -u -d -r2.148 -r2.149
--- script_v72he.cpp	3 Oct 2004 14:13:04 -0000	2.148
+++ script_v72he.cpp	3 Oct 2004 14:24:28 -0000	2.149
@@ -2412,7 +2412,7 @@
 }
 
 void ScummEngine_v72he::o72_getResourceSize() {
-	int size, type;
+	int size = 0, type;
 
 	int idx = pop();
 	byte subOp = fetchScriptByte();
@@ -2443,7 +2443,8 @@
 	}
 
 	const byte *ptr = getResourceAddress(type, idx);
-	size = READ_BE_UINT32(ptr + 4) - 8;	
+	if (ptr)
+		size = READ_BE_UINT32(ptr + 4) - 8;
 	push(size);
 }
 





More information about the Scummvm-git-logs mailing list