[Scummvm-cvs-logs] SF.net SVN: scummvm: [33031] residual/trunk/engine/imuse/imuse_mcmp_mgr.cpp

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Sun Jul 13 14:25:06 CEST 2008


Revision: 33031
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33031&view=rev
Author:   aquadran
Date:     2008-07-13 05:25:05 -0700 (Sun, 13 Jul 2008)

Log Message:
-----------
added buffer hack specific for vima codec, similiar thing has comi in scummvm too

Modified Paths:
--------------
    residual/trunk/engine/imuse/imuse_mcmp_mgr.cpp

Modified: residual/trunk/engine/imuse/imuse_mcmp_mgr.cpp
===================================================================
--- residual/trunk/engine/imuse/imuse_mcmp_mgr.cpp	2008-07-13 12:20:24 UTC (rev 33030)
+++ residual/trunk/engine/imuse/imuse_mcmp_mgr.cpp	2008-07-13 12:25:05 UTC (rev 33031)
@@ -99,7 +99,8 @@
 		_compTable[i].offset += sizeCodecs;
 	}
 	fseek(_file, sizeCodecs, SEEK_CUR);
-	_compInput = new byte[maxSize];
+	// hack: one more byte at the end of input buffer
+	_compInput = new byte[maxSize + ];
 	fread(_compInput, 1, headerSize, _file);
 	*resPtr = _compInput;
 	offsetData = headerSize;
@@ -129,6 +130,8 @@
 
 	for (i = first_block; i <= last_block; i++) {
 		if (_lastBlock != i) {
+			// hack: one more zero byte at the end of input buffer
+			_compInput[_compTable[i].compSize] = 0;
 			fseek(_file, _compTable[i].offset, SEEK_SET);
 			fread(_compInput, 1, _compTable[i].compSize, _file);
 			decompressVima(_compInput, (int16 *)_compOutput, _compTable[i].decompSize, imuseDestTable);


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