[Scummvm-cvs-logs] SF.net SVN: scummvm: [25877] scummvm/trunk/engines/kyra/sound_towns.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Feb 26 12:16:32 CET 2007


Revision: 25877
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25877&view=rev
Author:   fingolfin
Date:     2007-02-26 03:16:31 -0800 (Mon, 26 Feb 2007)

Log Message:
-----------
Using FLAG_AUTOFREE implies free() being called on the memory buffer you passed to the audio stream code -- hence, use malloc and not new[] to allocate the buffer

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/sound_towns.cpp

Modified: scummvm/trunk/engines/kyra/sound_towns.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_towns.cpp	2007-02-26 07:13:54 UTC (rev 25876)
+++ scummvm/trunk/engines/kyra/sound_towns.cpp	2007-02-26 11:16:31 UTC (rev 25877)
@@ -206,10 +206,10 @@
 	uint32 playbackBufferSize = (sfxHeaderID == 1) ? sfxHeaderInBufferSize : sfxHeaderOutBufferSize;
 
 	stopSoundEffect();
-	uint8 *sfxPlaybackBuffer = new uint8[playbackBufferSize];
+	uint8 *sfxPlaybackBuffer = (uint8 *)malloc(playbackBufferSize);
 	memset(sfxPlaybackBuffer, 0x80, playbackBufferSize);
 
-	uint8 * sfxBody = ((uint8*)sfxHeader) + 0x20;
+	uint8 *sfxBody = ((uint8 *)sfxHeader) + 0x20;
 
 	if (!sfxHeaderID) {
 		memcpy(sfxPlaybackBuffer, sfxBody, playbackBufferSize);


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