Commit 07dda951 by Geoff Lang Committed by Shannon Woods

Protect against integer overflows in the IndexBuffer class by validating that…

Protect against integer overflows in the IndexBuffer class by validating that the new write position will not overflow. Issue 444 Signed-off-by: Jamie Madil Signed-off-by: Shannon Woods Author: Geoff Lang
parent 27a1020f
......@@ -380,7 +380,7 @@ void StreamingIndexBuffer::reserveSpace(UINT requiredSpace, GLenum type)
mWritePosition = 0;
}
else if (mWritePosition + requiredSpace > mBufferSize) // Recycle
else if (mWritePosition + requiredSpace > mBufferSize || mWritePosition + requiredSpace < mWritePosition) // Recycle
{
void *dummy;
mIndexBuffer->Lock(0, 1, &dummy, D3DLOCK_DISCARD);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment