[Scummvm-cvs-logs] SF.net SVN: scummvm: [30833] scummvm/trunk/engines/kyra/resource.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Feb 9 15:43:43 CET 2008


Revision: 30833
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30833&view=rev
Author:   lordhoto
Date:     2008-02-09 06:43:43 -0800 (Sat, 09 Feb 2008)

Log Message:
-----------
Added another check if PAK file is corrupted.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/resource.cpp

Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp	2008-02-09 14:40:52 UTC (rev 30832)
+++ scummvm/trunk/engines/kyra/resource.cpp	2008-02-09 14:43:43 UTC (rev 30833)
@@ -415,6 +415,12 @@
 	}
 
 	while (!stream.eos()) {
+		// The start offset of a file should never be in the filelist
+		if (startoffset < stream.pos()) {
+			warning("PAK file '%s' is corrupted", filename.c_str());
+			return false;
+		}
+
 		Common::String file = "";
 		byte c = 0;
 


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