aboutsummaryrefslogtreecommitdiff
path: root/scumm/sound.cpp
diff options
context:
space:
mode:
authorPaweł Kołodziejski2003-03-07 07:49:10 +0000
committerPaweł Kołodziejski2003-03-07 07:49:10 +0000
commit39510ce4cc4f0cefe79da06fedee2b1f36c752f9 (patch)
treea45f6effe92f82eb33c263751586ce5ce7cb64d9 /scumm/sound.cpp
parent6c3ea05205feddffd1e8d0d83ea01e5c719ebfde (diff)
downloadscummvm-rg350-39510ce4cc4f0cefe79da06fedee2b1f36c752f9.tar.gz
scummvm-rg350-39510ce4cc4f0cefe79da06fedee2b1f36c752f9.tar.bz2
scummvm-rg350-39510ce4cc4f0cefe79da06fedee2b1f36c752f9.zip
changed voice buffer allocation to needed size
svn-id: r6737
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r--scumm/sound.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index b32e1841b7..d455d48b8f 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -1194,21 +1194,18 @@ int Sound::playBundleSound(char *sound) {
strcpy(name, sound);
if (_scumm->_maxRooms != 6) // CMI demo does not have .IMX for voice but does for music...
strcat(name, ".IMX");
- ptr = (byte *)malloc(1000000);
- output_size = _scumm->_bundle->decompressVoiceSampleByName(name, ptr);
+ output_size = _scumm->_bundle->decompressVoiceSampleByName(name, &ptr);
if (output_size == 0) {
free(ptr);
return -1;
}
} else {
- ptr = (byte *)malloc(1000000);
- output_size = _scumm->_bundle->decompressVoiceSampleByName(sound, ptr);
+ output_size = _scumm->_bundle->decompressVoiceSampleByName(sound, &ptr);
if (output_size == 0) {
free(ptr);
return -1;
}
}
- assert(output_size <= 1000000);
orig_ptr = ptr;
tag = READ_BE_UINT32(ptr); ptr += 4;