aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2007-12-24 14:40:39 +0000
committerMax Horn2007-12-24 14:40:39 +0000
commitd973d3736c60d2510ff779a4584e67d2b05c958b (patch)
treedf2d40cc5f4b71d1fb50fc1a816757864f9c8a03 /engines/scumm
parent138263ec035bc7a38fe49aa7296adfaa6d0bf6e1 (diff)
downloadscummvm-rg350-d973d3736c60d2510ff779a4584e67d2b05c958b.tar.gz
scummvm-rg350-d973d3736c60d2510ff779a4584e67d2b05c958b.tar.bz2
scummvm-rg350-d973d3736c60d2510ff779a4584e67d2b05c958b.zip
cleanup; workaround for bug #1852635 (INDY3 Mac: Crash When Playing Sound 54)
svn-id: r29975
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/sound.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index ed67829cdd..d36f30841b 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -160,7 +160,6 @@ void Sound::processSoundQueues() {
}
void Sound::playSound(int soundID) {
- byte *mallocedPtr = NULL;
byte *ptr;
char *sound;
int size = -1;
@@ -352,7 +351,6 @@ void Sound::playSound(int soundID) {
ptr += 0x16;
if (soundID == _currentCDSound && pollCD() == 1) {
- free(mallocedPtr);
return;
}
@@ -397,9 +395,12 @@ void Sound::playSound(int soundID) {
}
else if ((_vm->_game.platform == Common::kPlatformMacintosh) && (_vm->_game.id == GID_INDY3) && (ptr[26] == 0)) {
size = READ_BE_UINT16(ptr + 12);
+ if (size == 0) // WORKAROUND bug #1852635: Sound 54 has size 0.
+ return;
rate = 3579545 / READ_BE_UINT16(ptr + 20);
sound = (char *)malloc(size);
int vol = ptr[24] * 4;
+
memcpy(sound, ptr + READ_BE_UINT16(ptr + 8), size);
_mixer->playRaw(Audio::Mixer::kSFXSoundType, NULL, sound, size, rate, Audio::Mixer::FLAG_AUTOFREE, soundID, vol, 0);
}
@@ -441,8 +442,6 @@ void Sound::playSound(int soundID) {
_vm->_musicEngine->startSound(soundID);
}
}
-
- free(mallocedPtr);
}
void Sound::processSfxQueues() {