From c6b301b72e2713ce058c65f9ed5cfe361755ea38 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 14 Feb 2022 03:04:46 -0800 Subject: Access the proper FX slot index --- al/source.cpp | 2 +- alc/context.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/al/source.cpp b/al/source.cpp index 30676dfc..9817674f 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -3989,7 +3989,7 @@ void ALsource::eax_set_fx_slots() if (fx_slot_index.has_value()) { eax_has_active_fx_slots_ = true; - eax_active_fx_slots_[fx_slot_index] = true; + eax_active_fx_slots_[*fx_slot_index] = true; } } diff --git a/alc/context.cpp b/alc/context.cpp index c51abdae..84221c3d 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -758,12 +758,14 @@ void ALCcontext::eax_unlock_legacy_fx_slots(const EaxEaxCall& eax_call) noexcept void ALCcontext::eax_dispatch_fx_slot( const EaxEaxCall& eax_call) { - auto& fx_slot = eax_get_fx_slot(eax_call.get_fx_slot_index()); + const auto fx_slot_index = eax_call.get_fx_slot_index(); + if(!fx_slot_index.has_value()) + eax_fail("Invalid fx slot index."); - if (fx_slot.eax_dispatch(eax_call)) + auto& fx_slot = eax_get_fx_slot(*fx_slot_index); + if(fx_slot.eax_dispatch(eax_call)) { std::lock_guard source_lock{mSourceLock}; - eax_update_filters(); } } -- cgit v1.2.3