[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,1.395,1.396
Max Horn
fingolfin at users.sourceforge.net
Tue Sep 21 05:30:00 CEST 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm script_v7he.cpp,2.98,2.99
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm palette.cpp,2.17,2.18 saveload.cpp,1.176,1.177 scumm.cpp,1.223,1.224 scumm.h,1.491,1.492 vars.cpp,1.106,1.107
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10280
Modified Files:
sound.cpp
Log Message:
Fix memory leak
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.395
retrieving revision 1.396
diff -u -d -r1.395 -r1.396
--- sound.cpp 21 Sep 2004 01:07:29 -0000 1.395
+++ sound.cpp 21 Sep 2004 12:29:02 -0000 1.396
@@ -216,7 +216,7 @@
}
musicFile.seek(music_offs, SEEK_SET);
- ptr = (byte *) calloc(size, 1);
+ ptr = (byte *)malloc(size);
musicFile.read(ptr, size);
musicFile.close();
@@ -224,11 +224,8 @@
music = true;
if (_vm->_heversion == 70) {
// Allocate a sound buffer, copy the data into it, and play
- sound = (char *)malloc(size);
- memcpy(sound, ptr, size);
- free(ptr);
_vm->_mixer->stopHandle(_musicChannelHandle);
- _vm->_mixer->playRaw(&_musicChannelHandle, sound, size, 11025, flags, soundID);
+ _vm->_mixer->playRaw(&_musicChannelHandle, ptr, size, 11025, flags, soundID);
return;
}
} else {
@@ -766,7 +763,7 @@
} else if (sound == -1 || sound == 10000) {
// getSoundStatus(), with a -1, will return the
// ID number of the first active music it finds.
- if (_vm->_heversion >= 70 || _currentMusic)
+ if (_vm->_heversion >= 70 || _currentMusic)
return (_musicChannelHandle.isActive()) ? 1 : 0;
else if (_vm->_imuse)
return (_vm->_imuse->getSoundStatus(sound));
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm script_v7he.cpp,2.98,2.99
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm palette.cpp,2.17,2.18 saveload.cpp,1.176,1.177 scumm.cpp,1.223,1.224 scumm.h,1.491,1.492 vars.cpp,1.106,1.107
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list