aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-09-19 14:00:55 -0700
committerChris Robinson <[email protected]>2010-09-19 14:00:55 -0700
commita2580a85a82bdfdd25f71e17fe233ec5beaac2e0 (patch)
treead169708207c87e9e9865eeb0385aaee98a23782
parent8a0e15ff37b3eb8e010b9da32d85120e4ef2e8cc (diff)
Improve range checking for BufferSubData
-rw-r--r--OpenAL32/alBuffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 938caca2..2ffa13e6 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -584,8 +584,8 @@ 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(offset+length < offset ||
- offset+length > ALBuf->OriginalSize ||
+ else if(offset > ALBuf->OriginalSize ||
+ length > ALBuf->OriginalSize-offset ||
(offset%ALBuf->OriginalAlign) != 0 ||
(length%ALBuf->OriginalAlign) != 0)
alSetError(Context, AL_INVALID_VALUE);