From 02558ea5b35d4cebbb389c19cedfa56880128139 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 12 Aug 2011 05:19:21 -0700 Subject: [PATCH] Add and use EAX_MAX_ENVIRONMENT --- eax.h | 3 ++- primary.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eax.h b/eax.h index 210cc91..00138e5 100644 --- a/eax.h +++ b/eax.h @@ -159,7 +159,8 @@ enum { EAX_ENVIRONMENT_DIZZY, EAX_ENVIRONMENT_PSYCHOTIC, - EAX_ENVIRONMENT_COUNT + EAX_ENVIRONMENT_COUNT, + EAX_MAX_ENVIRONMENT = EAX_ENVIRONMENT_COUNT-1 }; extern const EAXLISTENERPROPERTIES EnvironmentDefaults[EAX_ENVIRONMENT_COUNT]; diff --git a/primary.c b/primary.c index a6ab2b9..0f1d976 100644 --- a/primary.c +++ b/primary.c @@ -1902,7 +1902,7 @@ static HRESULT WINAPI DS8PrimaryProp_Set(IKsPropertySet *iface, const DWORD *dw; } data = { pPropData }; - if(*data.dw < EAX_ENVIRONMENT_COUNT) + if(*data.dw <= EAX_MAX_ENVIRONMENT) { /* Get the environment index's default and pass it down to * ALLPARAMETERS */ -- 2.11.4.GIT