aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-08-15 10:01:55 -0700
committerChris Robinson <[email protected]>2009-08-15 10:01:55 -0700
commit01e32b58dafb0c1194b471760b093f669786cb69 (patch)
tree7d0859bd1c36eeea9e498db5abc7e6ac2a704b83
parent9d05ff0468640b29c2a23b45c24d1f207dd9389f (diff)
Fix some size checks
-rw-r--r--Alc/ALc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 7143436f..8934f3d7 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -798,35 +798,35 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
switch (param)
{
case ALC_MAJOR_VERSION:
- if(!size)
+ if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = alcMajorVersion;
break;
case ALC_MINOR_VERSION:
- if(!size)
+ if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = alcMinorVersion;
break;
case ALC_EFX_MAJOR_VERSION:
- if(!size)
+ if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = alcEFXMajorVersion;
break;
case ALC_EFX_MINOR_VERSION:
- if(!size)
+ if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = alcEFXMinorVersion;
break;
case ALC_MAX_AUXILIARY_SENDS:
- if(!size)
+ if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = (device?device->NumAuxSends:MAX_SENDS);
@@ -835,7 +835,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
case ALC_ATTRIBUTES_SIZE:
if(!IsDevice(device))
SetALCError(ALC_INVALID_DEVICE);
- else if(!size)
+ else if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = 13;
@@ -877,7 +877,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
case ALC_FREQUENCY:
if(!IsDevice(device))
SetALCError(ALC_INVALID_DEVICE);
- else if(!size)
+ else if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = device->Frequency;
@@ -886,7 +886,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
case ALC_REFRESH:
if(!IsDevice(device))
SetALCError(ALC_INVALID_DEVICE);
- else if(!size)
+ else if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = device->Frequency / device->UpdateSize;
@@ -895,7 +895,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
case ALC_SYNC:
if(!IsDevice(device))
SetALCError(ALC_INVALID_DEVICE);
- else if(!size)
+ else if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = ALC_FALSE;
@@ -904,7 +904,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
case ALC_MONO_SOURCES:
if(!IsDevice(device))
SetALCError(ALC_INVALID_DEVICE);
- else if (size != 1)
+ else if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = device->lNumMonoSources;
@@ -913,7 +913,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
case ALC_STEREO_SOURCES:
if(!IsDevice(device))
SetALCError(ALC_INVALID_DEVICE);
- else if (size != 1)
+ else if(size <= 0)
SetALCError(ALC_INVALID_VALUE);
else
*data = device->lNumStereoSources;