From b4eaf1ab5a675ff0d75fbec2239fb0ce44d3e06c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 27 Nov 2010 22:22:14 -0800 Subject: Avoid a potential overflow when setting the source offset --- OpenAL32/alSource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenAL32/alSource.c') 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++; -- cgit v1.2.3