aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorHenrik "Henke37" Andersson2019-10-10 03:23:27 +0200
committerEugene Sandulenko2019-10-11 18:10:46 +0200
commit5675a00d8fa2be55d4ff366b65cfd4c0721ab4fe (patch)
tree634afc12919647e9c0c2f5e8b09d20beba669029 /engines/hdb
parent89b20bbb86608a6b61b56b13e9c35757bc5c4158 (diff)
downloadscummvm-rg350-5675a00d8fa2be55d4ff366b65cfd4c0721ab4fe.tar.gz
scummvm-rg350-5675a00d8fa2be55d4ff366b65cfd4c0721ab4fe.tar.bz2
scummvm-rg350-5675a00d8fa2be55d4ff366b65cfd4c0721ab4fe.zip
HDB: Bail if the music stream couldn't be created.
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/sound.cpp7
1 files changed, 5 insertions, 2 deletions
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) {