From b6ce351f6d65309175f53182be4c3d97f3ce3e62 Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Sun, 20 Jun 2004 13:19:22 +0000 Subject: fix for not finding sample svn-id: r13970 --- scumm/imuse_digi/dimuse_sndmgr.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp index 505eff5434..7e5a6b2513 100644 --- a/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -325,7 +325,10 @@ ImuseDigiSndMgr::soundStruct *ImuseDigiSndMgr::openSound(int32 soundId, const ch closeSound(sound); return NULL; } - sound->bundle->decompressSampleByIndex(soundId, 0, 0x2000, &ptr, 0, header_outside); + if (sound->bundle->decompressSampleByIndex(soundId, 0, 0x2000, &ptr, 0, header_outside) == 0) { + closeSound(sound); + return NULL; + } sound->soundId = soundId; sound->type = soundType; sound->volGroupId = volGroupId; @@ -345,7 +348,10 @@ ImuseDigiSndMgr::soundStruct *ImuseDigiSndMgr::openSound(int32 soundId, const ch closeSound(sound); return NULL; } - sound->bundle->decompressSampleByName(soundName, 0, 0x2000, &ptr, header_outside); + if (sound->bundle->decompressSampleByName(soundName, 0, 0x2000, &ptr, header_outside) == 0) { + closeSound(sound); + return NULL; + } strcpy(sound->name, soundName); sound->soundId = soundId; sound->type = soundType; -- cgit v1.2.3