From dddce5d97b0c9b0cf723d16ead08d5a00ad7eca0 Mon Sep 17 00:00:00 2001 From: Robert Špalek Date: Thu, 15 Oct 2009 23:57:13 +0000 Subject: Don't crash without sound support. svn-id: r45137 --- engines/draci/detection.cpp | 10 +++++++--- engines/draci/sound.cpp | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 1d58d25cfa..f9fb7ffa54 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -143,9 +143,13 @@ SaveStateList DraciMetaEngine::listSaves(const char *target) const { Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { Draci::DraciSavegameHeader header; - Draci::readSavegameHeader(in, header); - saveList.push_back(SaveStateDescriptor(slotNum, header.saveName)); - if (header.thumbnail) delete header.thumbnail; + if (Draci::readSavegameHeader(in, header)) { + saveList.push_back(SaveStateDescriptor(slotNum, header.saveName)); + if (header.thumbnail) { + header.thumbnail->free(); + delete header.thumbnail; + } + } delete in; } } diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index 09c7aad4ca..6b6e18f364 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -269,8 +269,12 @@ void Sound::stopAll() { void Sound::setVolume() { // TODO: how to retrieve "Mute All" ? - _muteSound = ConfMan.getBool("sfx_mute"); - _muteVoice = ConfMan.getBool("speech_mute"); + if (_mixer->isReady()) { + _muteSound = ConfMan.getBool("sfx_mute"); + _muteVoice = ConfMan.getBool("speech_mute"); + } else { + _muteSound = _muteVoice = true; + } _showSubtitles = ConfMan.getBool("subtitles"); _talkSpeed = ConfMan.getInt("talkspeed"); const int soundVolume = ConfMan.getInt("sfx_volume"); -- cgit v1.2.3