From e56cda1350ac66580a35805484e758b7f7e37786 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 28 May 2017 17:18:35 +0300 Subject: [PATCH] Fixed crash on change particular sound options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Happened only when there is a current song but it’s not played, for example in title screen https://forum.zdoom.org/viewtopic.php?t=56631 --- src/sound/i_musicinterns.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sound/i_musicinterns.h b/src/sound/i_musicinterns.h index 531d69ec7..9bf9f8aed 100644 --- a/src/sound/i_musicinterns.h +++ b/src/sound/i_musicinterns.h @@ -363,7 +363,12 @@ public: void WildMidiSetOption(int opt, int set); void CreateSMF(TArray &file, int looplimit=0); int ServiceEvent(); - int GetDeviceType() const override { return MIDI->GetDeviceType(); } + int GetDeviceType() const override + { + return nullptr == MIDI + ? MusInfo::GetDeviceType() + : MIDI->GetDeviceType(); + } protected: MIDIStreamer(const char *dumpname, EMidiDevice type);