aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alBuffer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-05-24 21:33:43 -0700
committerChris Robinson <[email protected]>2010-05-24 21:33:43 -0700
commitc6b948323ebc8632e0b763f090cdcd19255d0ac2 (patch)
treee430867bb99dd1729aaa2ffd7af103d18417b474 /OpenAL32/alBuffer.c
parentad2957ed984ff7710725cf0cce43490da41bd161 (diff)
Better watch for invalid values in alBufferSubDataEXT
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r--OpenAL32/alBuffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 8589f330..72af95f0 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -582,10 +582,10 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const A
alSetError(Context, AL_INVALID_VALUE);
else if(ALBuf->eOriginalFormat != format)
alSetError(Context, AL_INVALID_ENUM);
- else if(ALBuf->OriginalAlign == 0 ||
+ else if(offset+length < offset ||
+ offset+length > ALBuf->OriginalSize ||
(offset%ALBuf->OriginalAlign) != 0 ||
- (length%ALBuf->OriginalAlign) != 0 ||
- offset+length > ALBuf->OriginalSize)
+ (length%ALBuf->OriginalAlign) != 0)
alSetError(Context, AL_INVALID_VALUE);
else
{