aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2006-01-29 17:47:38 +0000
committerMax Horn2006-01-29 17:47:38 +0000
commit2ce2bac35c51ed0854c644874696993e382e5d5e (patch)
treeeda9f9b4a7a7edfce84df9bc3df7cb38fd0b04f5 /scumm
parent83d6bd606c923751062a7694159e0e796a580bcc (diff)
downloadscummvm-rg350-2ce2bac35c51ed0854c644874696993e382e5d5e.tar.gz
scummvm-rg350-2ce2bac35c51ed0854c644874696993e382e5d5e.tar.bz2
scummvm-rg350-2ce2bac35c51ed0854c644874696993e382e5d5e.zip
cleanup
svn-id: r20300
Diffstat (limited to 'scumm')
-rw-r--r--scumm/sound.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 588e204c7a..f3a6168de3 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -2187,20 +2187,17 @@ int ScummEngine::readSoundResourceSmallHeader(int type, int idx) {
// + some default instruments
byte *ptr;
if (_features & GF_OLD_BUNDLE) {
- ptr = (byte *) calloc(ad_size - 4, 1);
+ ad_size -= 4;
_fileHandle->seek(ad_offs + 4, SEEK_SET);
- _fileHandle->read(ptr, ad_size - 4);
- convertADResource(type, idx, ptr, ad_size - 4);
- free(ptr);
- return 1;
} else {
- ptr = (byte *) calloc(ad_size - 6, 1);
+ ad_size -= 6;
_fileHandle->seek(ad_offs, SEEK_SET);
- _fileHandle->read(ptr, ad_size - 6);
- convertADResource(type, idx, ptr, ad_size - 6);
- free(ptr);
- return 1;
}
+ ptr = (byte *) calloc(ad_size, 1);
+ _fileHandle->read(ptr, ad_size);
+ convertADResource(type, idx, ptr, ad_size);
+ free(ptr);
+ return 1;
} else if ((_musicType == MDT_PCSPK) && wa_offs != 0) {
if (_features & GF_OLD_BUNDLE) {
_fileHandle->seek(wa_offs, SEEK_SET);