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

waltervn at users.sourceforge.net waltervn at users.sourceforge.net
Thu Jun 4 18:18:35 CEST 2009


Revision: 41171
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41171&view=rev
Author:   waltervn
Date:     2009-06-04 16:18:35 +0000 (Thu, 04 Jun 2009)

Log Message:
-----------
SCI: Audio: Fixed bug in reading of SOL header.

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

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2009-06-04 15:56:11 UTC (rev 41170)
+++ scummvm/trunk/engines/sci/resource.cpp	2009-06-04 16:18:35 UTC (rev 41171)
@@ -1487,6 +1487,12 @@
 	}
 
 	int headerSize = audioStream->readByte();
+
+	if (headerSize != 11 && headerSize != 12) {
+		warning("SOL audio header of size %i not supported", headerSize);
+		return NULL;
+	}
+
 	audioStream->readUint32LE();			// skip "SOL" + 0 (4 bytes)
 	*audioRate = audioStream->readUint16LE();
 	audioFlags = audioStream->readByte();
@@ -1498,10 +1504,12 @@
 	if (!(audioFlags & kSolFlagIsSigned))
 		*flags |= Audio::Mixer::FLAG_UNSIGNED;
 
-	*size = audioStream->readUint16LE();
+	*size = audioStream->readUint32LE();
 
-	if (headerSize == 12)
-		*size |= audioStream->readByte() << 16;
+	if (headerSize == 12) {
+		// Unknown byte
+		audioStream->readByte();
+	}
 
 	byte *buffer;
 


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