From c12538c346ebb10ee884afeb24839264f5809924 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 14 Sep 2011 23:34:28 +0000 Subject: [PATCH] - Fixed crash when trying to play a MIDI file with no notes. SVN r3294 (trunk) --- src/sound/music_midistream.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sound/music_midistream.cpp b/src/sound/music_midistream.cpp index f9c2d4f280..c8c8ab08ed 100644 --- a/src/sound/music_midistream.cpp +++ b/src/sound/music_midistream.cpp @@ -339,6 +339,10 @@ void MIDIStreamer::Play(bool looping, int subsong) if (MIDI->Preprocess(this, looping)) { StartPlayback(); + if (MIDI == NULL) + { // The MIDI file had no content and has been automatically closed. + return; + } } if (0 != MIDI->Resume())