aboutsummaryrefslogtreecommitdiffstats
path: root/alc/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/context.cpp')
-rw-r--r--alc/context.cpp8
1 files changed, 5 insertions, 3 deletions
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<std::mutex> source_lock{mSourceLock};
-
eax_update_filters();
}
}