aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-27 22:22:14 -0800
committerChris Robinson <[email protected]>2010-11-27 22:22:14 -0800
commitb4eaf1ab5a675ff0d75fbec2239fb0ce44d3e06c (patch)
tree49b2fdc1074bbd09deca6f9cd88ccdc4c80e05da
parent3c8e9a7f2411789dc56b7ac11d24a2ea30be1cde (diff)
Avoid a potential overflow when setting the source offset
-rw-r--r--OpenAL32/alSource.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 1cb8b78e..8cd1d4a1 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1949,7 +1949,7 @@ static ALboolean ApplyOffset(ALsource *Source)
Buffer = BufferList->buffer;
lBufferSize = Buffer ? Buffer->size : 0;
- if(lTotalBufferSize+lBufferSize <= lByteOffset)
+ if(lBufferSize <= lByteOffset-lTotalBufferSize)
{
// Offset is past this buffer so increment BuffersPlayed
BuffersPlayed++;