From 5675a00d8fa2be55d4ff366b65cfd4c0721ab4fe Mon Sep 17 00:00:00 2001 From: Henrik "Henke37" Andersson Date: Thu, 10 Oct 2019 03:23:27 +0200 Subject: HDB: Bail if the music stream couldn't be created. --- engines/hdb/sound.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/hdb') diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp index 5edde1127c..d69618ace3 100644 --- a/engines/hdb/sound.cpp +++ b/engines/hdb/sound.cpp @@ -1789,12 +1789,15 @@ void Song::stop() { } void Song::playSong(SoundType song, bool fadeIn, int ramp) { - this->_song = song; - this->_playing = true; Common::String fileName = getFileName(song); Audio::AudioStream* musicStream = createStream(fileName); + if (musicStream == nullptr) return; + + this->_song = song; + this->_playing = true; + int initialVolume; if (fadeIn) { -- cgit v1.2.3