summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r--src/audio/AudioManager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index a42aa16f..d8054181 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -321,8 +321,13 @@ cAudioManager::Get3DProviderName(uint8 id) const
{
if (!m_bIsInitialised)
return nil;
+#ifdef AUDIO_OAL
+ id = clamp(id, 0, SampleManager.GetNum3DProvidersAvailable() - 1);
+#else
+ // We don't want that either since it will crash the game, but skipping for now
if (id >= SampleManager.GetNum3DProvidersAvailable())
return nil;
+#endif
return SampleManager.Get3DProviderName(id);
}