From d8394a61e0bf71b41851b4fdf2094ac2614204e0 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Thu, 2 Aug 2018 20:19:37 +0200 Subject: add safety check for emulator switching --- src/adlmidi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/adlmidi.cpp') diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index ab0c0c4..c7c5cf3 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -613,7 +613,7 @@ ADLMIDI_EXPORT int adl_switchEmulator(struct ADL_MIDIPlayer *device, int emulato assert(play); if(!play) return -1; - if((emulator >= 0) && (emulator < ADLMIDI_EMU_end)) + if(adl_isEmulatorAvailable(emulator)) { play->m_setup.emulator = emulator; play->partialReset(); -- cgit v1.2.3