From 3d16be18221132db9a0e43a5eb2c7c314809859f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 24 May 2010 19:02:36 -0700 Subject: Fix alBufferiv error handling --- OpenAL32/alBuffer.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 754a5b35..759062aa 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -838,13 +838,15 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum eParam, const ALint* pl ALCdevice *device; ALbuffer *ALBuf; - (void)plValues; - pContext = GetContextSuspended(); if(!pContext) return; device = pContext->Device; - if((ALBuf=LookupBuffer(device->BufferMap, buffer)) != NULL) + if(!plValues) + alSetError(pContext, AL_INVALID_VALUE); + else if((ALBuf=LookupBuffer(device->BufferMap, buffer)) == NULL) + alSetError(pContext, AL_INVALID_NAME); + else { switch(eParam) { @@ -873,10 +875,6 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum eParam, const ALint* pl break; } } - else - { - alSetError(pContext, AL_INVALID_NAME); - } ProcessContext(pContext); } -- cgit v1.2.3