[Scummvm-cvs-logs] SF.net SVN: scummvm:[48035] scummvm/trunk/engines/mohawk/video/cinepak.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Wed Feb 10 18:46:23 CET 2010


Revision: 48035
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48035&view=rev
Author:   mthreepwood
Date:     2010-02-10 17:46:22 +0000 (Wed, 10 Feb 2010)

Log Message:
-----------
Fix a potential problem for some compilers with having multiple stream reads.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/video/cinepak.cpp

Modified: scummvm/trunk/engines/mohawk/video/cinepak.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/video/cinepak.cpp	2010-02-10 17:08:07 UTC (rev 48034)
+++ scummvm/trunk/engines/mohawk/video/cinepak.cpp	2010-02-10 17:46:22 UTC (rev 48035)
@@ -114,7 +114,10 @@
 			if (stream->eos())
 				break;
 
-			uint32 chunkSize = (stream->readByte() << 16) + stream->readUint16BE() - 4; // 24bit
+			// Chunk Size is 24-bit, ignore the first 4 bytes
+			uint32 chunkSize = stream->readByte() << 16;
+			chunkSize += stream->readUint16BE() - 4;
+
 			int32 startPos = stream->pos();
 
 			switch (chunkID) {


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