aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'scumm')
-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;