diff options
author | Chris Robinson <[email protected]> | 2009-05-31 11:34:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-05-31 11:34:07 -0700 |
commit | 7940003d0624d76e798523577d3d97cf99b73c83 (patch) | |
tree | 1793ffbd867da33728f5df7855b6eeccacb1e912 /OpenAL32 | |
parent | 45b16ff4561aea91e462035c5e6349db38b35bf2 (diff) |
Set an error if NaN is given for panning values
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alEffect.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c index fe5897c9..f41c769e 100644 --- a/OpenAL32/alEffect.c +++ b/OpenAL32/alEffect.c @@ -21,6 +21,7 @@ #include "config.h" #include <stdlib.h> +#include <math.h> #include "AL/al.h" #include "AL/alc.h" @@ -666,14 +667,24 @@ ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues) break; case AL_EAXREVERB_REFLECTIONS_PAN: - ALEffect->Reverb.ReflectionsPan[0] = pflValues[0]; - ALEffect->Reverb.ReflectionsPan[1] = pflValues[1]; - ALEffect->Reverb.ReflectionsPan[2] = pflValues[2]; + if(!isnan(pflValues[0]) && !isnan(pflValues[1]) && !isnan(pflValues[2])) + { + ALEffect->Reverb.ReflectionsPan[0] = pflValues[0]; + ALEffect->Reverb.ReflectionsPan[1] = pflValues[1]; + ALEffect->Reverb.ReflectionsPan[2] = pflValues[2]; + } + else + alSetError(AL_INVALID_VALUE); break; case AL_EAXREVERB_LATE_REVERB_PAN: - ALEffect->Reverb.LateReverbPan[0] = pflValues[0]; - ALEffect->Reverb.LateReverbPan[1] = pflValues[1]; - ALEffect->Reverb.LateReverbPan[2] = pflValues[2]; + if(!isnan(pflValues[0]) && !isnan(pflValues[1]) && !isnan(pflValues[2])) + { + ALEffect->Reverb.LateReverbPan[0] = pflValues[0]; + ALEffect->Reverb.LateReverbPan[1] = pflValues[1]; + ALEffect->Reverb.LateReverbPan[2] = pflValues[2]; + } + else + alSetError(AL_INVALID_VALUE); break; default: |