Skip to content

Commit

Permalink
native_midi_win32.c (native_midi_active): Fixed possible crash
Browse files Browse the repository at this point in the history
In some cases, I have recognized a crash, mainly, on attempt to verify
the activity state while NativeMIDI is not initialized.
  • Loading branch information
Wohlstand committed Nov 26, 2019
1 parent 7462431 commit 5f7c973
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/codecs/native_midi/native_midi_win32.c
Expand Up @@ -298,6 +298,10 @@ void native_midi_stop(void)

int native_midi_active(void)
{
if (!hMidiStream)
return 0;
if (!currentsong)
return 0;
return currentsong->MusicPlaying;
}

Expand Down

0 comments on commit 5f7c973

Please sign in to comment.