[Scummvm-cvs-logs] SF.net SVN: scummvm:[49190] scummvm/trunk/common/macresman.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Mon May 24 18:51:33 CEST 2010


Revision: 49190
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49190&view=rev
Author:   mthreepwood
Date:     2010-05-24 16:51:33 +0000 (Mon, 24 May 2010)

Log Message:
-----------
Have the MacResManager ignore resources with length 0.

Modified Paths:
--------------
    scummvm/trunk/common/macresman.cpp

Modified: scummvm/trunk/common/macresman.cpp
===================================================================
--- scummvm/trunk/common/macresman.cpp	2010-05-24 15:39:30 UTC (rev 49189)
+++ scummvm/trunk/common/macresman.cpp	2010-05-24 16:51:33 UTC (rev 49190)
@@ -439,6 +439,11 @@
 
 	_stream->seek(_dataOffset + _resLists[typeNum][resNum].dataOffset);
 	uint32 len = _stream->readUint32BE();
+
+	// Ignore resources with 0 length
+	if (!len)
+		return 0;
+
 	return _stream->readStream(len);
 }
 
@@ -448,6 +453,11 @@
 			if (_resLists[i][j].nameOffset != -1 && filename.equalsIgnoreCase(_resLists[i][j].name)) {
 				_stream->seek(_dataOffset + _resLists[i][j].dataOffset);
 				uint32 len = _stream->readUint32BE();
+
+				// Ignore resources with 0 length
+				if (!len)
+					return 0;
+
 				return _stream->readStream(len);
 			}
 		}


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