aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2005-02-06 10:09:37 +0000
committerPaweł Kołodziejski2005-02-06 10:09:37 +0000
commitac72fcd63dcf0684ffbd4b8c0f133fb8767a0953 (patch)
treec01184e46ed044b08722113a8003bfd48194267d
parentd261e3c9d3b549cb5b2deb83a870fad8db6f69cb (diff)
downloadscummvm-rg350-ac72fcd63dcf0684ffbd4b8c0f133fb8767a0953.tar.gz
scummvm-rg350-ac72fcd63dcf0684ffbd4b8c0f133fb8767a0953.tar.bz2
scummvm-rg350-ac72fcd63dcf0684ffbd4b8c0f133fb8767a0953.zip
return null if sound is not found
svn-id: r16737
-rw-r--r--scumm/imuse_digi/dimuse_bndmgr.cpp5
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp4
2 files changed, 7 insertions, 2 deletions
diff --git a/scumm/imuse_digi/dimuse_bndmgr.cpp b/scumm/imuse_digi/dimuse_bndmgr.cpp
index 5a7de3dfd7..c9690753b2 100644
--- a/scumm/imuse_digi/dimuse_bndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_bndmgr.cpp
@@ -140,10 +140,11 @@ File *BundleMgr::getFile(const char *filename, int32 &offset, int32 &size) {
_file.seek(_bundleTable[i].offset, SEEK_SET);
offset = _bundleTable[i].offset;
size = _bundleTable[i].size;
- break;
+ return &_file;
}
}
- return &_file;
+
+ return NULL;
}
bool BundleMgr::open(const char *filename, bool &compressed) {
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index 16d55c5d91..d38caa8afb 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -366,6 +366,10 @@ ImuseDigiSndMgr::soundStruct *ImuseDigiSndMgr::openSound(int32 soundId, const ch
int32 offset = 0, size = 0;
sprintf(fileName, "%s.map", soundName);
File *rmapFile = sound->bundle->getFile(fileName, offset, size);
+ if (!rmapFile) {
+ closeSound(sound);
+ return NULL;
+ }
prepareSoundFromRMAP(rmapFile, sound, offset, size);
strcpy(sound->name, soundName);
sound->soundId = soundId;