[Scummvm-cvs-logs] CVS: scummvm/scumm imuse_digi.cpp,1.72,1.73

Max Horn fingolfin at users.sourceforge.net
Wed Dec 24 09:48:01 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv9851

Modified Files:
	imuse_digi.cpp 
Log Message:
fix memory leak

Index: imuse_digi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- imuse_digi.cpp	24 Dec 2003 17:42:19 -0000	1.72
+++ imuse_digi.cpp	24 Dec 2003 17:47:43 -0000	1.73
@@ -796,18 +796,15 @@
 
 			mixer_size &= ~1;	// Size *must* be even, after all this is stereo data
 
-			byte *buf = (byte *)malloc(mixer_size);
-			memcpy(buf, _channel[l].data + _channel[l].offset, mixer_size);
-			_channel[l].offset += mixer_size;
-
 			if (_scumm->_mixer->isReady()) {
 				if (!_channel[l].handle.isActive())
 					_scumm->_mixer->newStream(&_channel[l].handle, _channel[l].freq, 
 											_channel[l].mixerFlags, 100000);
 				_scumm->_mixer->setChannelVolume(_channel[l].handle, _channel[l].vol / 1000);
 				_scumm->_mixer->setChannelPan(_channel[l].handle, _channel[l].pan);
-				_scumm->_mixer->appendStream(_channel[l].handle, buf, mixer_size);
+				_scumm->_mixer->appendStream(_channel[l].handle, _channel[l].data + _channel[l].offset, mixer_size);
 			}
+			_channel[l].offset += mixer_size;
 		}
 	}
 }





More information about the Scummvm-git-logs mailing list