[Scummvm-cvs-logs] SF.net SVN: scummvm:[54661] scummvm/trunk/engines/mohawk/livingbooks.cpp

fuzzie at users.sourceforge.net fuzzie at users.sourceforge.net
Tue Nov 30 01:11:15 CET 2010


Revision: 54661
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54661&view=rev
Author:   fuzzie
Date:     2010-11-30 00:11:15 +0000 (Tue, 30 Nov 2010)

Log Message:
-----------
MOHAWK: don't try reading non-existent messages

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/livingbooks.cpp

Modified: scummvm/trunk/engines/mohawk/livingbooks.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.cpp	2010-11-30 00:03:35 UTC (rev 54660)
+++ scummvm/trunk/engines/mohawk/livingbooks.cpp	2010-11-30 00:11:15 UTC (rev 54661)
@@ -1470,15 +1470,15 @@
 		error("Item is larger (should end at %d) than stream (size %d)", endPos, stream->size());
 
 	while (true) {
+		if (stream->pos() == endPos)
+			break;
+
 		uint16 dataType = stream->readUint16();
 		uint16 dataSize = stream->readUint16();
 
 		debug(4, "Data type %04x, size %d", dataType, dataSize);
 		readData(dataType, dataSize, stream);
 
-		if (stream->pos() == endPos)
-			break;
-
 		if (stream->pos() > endPos)
 			error("Read off the end (at %d) of data (ends at %d)", stream->pos(), endPos);
 


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