From f9bb64a5f3908739cae2b34420d7d9e8d95c754f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 13 Mar 2017 00:38:59 +0100 Subject: [PATCH] - fixed: MIDIStreamer::Update did not check if the device was still valid. Stopping a song can delete device while the streamer is still valid. --- src/sound/musicformats/music_midistream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sound/musicformats/music_midistream.cpp b/src/sound/musicformats/music_midistream.cpp index 1a47f3c2b..e23c03a3c 100644 --- a/src/sound/musicformats/music_midistream.cpp +++ b/src/sound/musicformats/music_midistream.cpp @@ -641,7 +641,7 @@ void MIDIStreamer::Callback(void *userdata) void MIDIStreamer::Update() { - if (!MIDI->Update()) Stop(); + if (MIDI != nullptr && !MIDI->Update()) Stop(); } //==========================================================================