diff --git a/CMakeLists.txt b/CMakeLists.txt index f39d224a..7cf37b37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) endif() -project ("sdl2-hyper-sonic-drivers" VERSION 0.12.1 DESCRIPTION "SDL2 based Hyper-Sonic Drivers for emulating old soundcards") +project ("sdl2-hyper-sonic-drivers" VERSION 0.12.2 DESCRIPTION "SDL2 based Hyper-Sonic Drivers for emulating old soundcards") include (TestBigEndian) TEST_BIG_ENDIAN(IS_BIG_ENDIAN) if(IS_BIG_ENDIAN) diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.cpp index 79d4d5c5..f2dec378 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.cpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.cpp @@ -164,6 +164,9 @@ namespace HyperSonicDrivers::drivers void MIDDriver::play(const uint8_t track) noexcept { + if (m_midi == nullptr) + return; + if (track >= m_midi->numTracks) { logW(std::format("track not available: {}", track)); diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp index 43e2b4ac..cb1ec3d8 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp @@ -233,6 +233,9 @@ namespace HyperSonicDrivers::drivers::westwood void ADLDriver::play(const uint8_t track) noexcept { std::scoped_lock lock(m_mutex); + + if (m_adl_file == nullptr) + return; constexpr uint8_t volume = std::numeric_limits::max(); const uint16_t soundId = m_adl_file->getTrack(track);