From 38b118d49ddbc8bd5d96cc0d23d681887fca045e Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Thu, 8 Dec 2011 11:23:22 -0800 Subject: [PATCH] mesa: Fix off-by-one error in transform feedback size check. In _mesa_BindBufferRange(), we need to verify that the offset and size specified by the client do not exceed the size of the underlying buffer. We were accidentally doing this check using ">=" rather than ">", so we were generating a bogus error if the client specified an offset and size that fit exactly in the underlying buffer. Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke --- src/mesa/main/transformfeedback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 824f66a3528..b0b75eaf5c3 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -473,7 +473,7 @@ _mesa_BindBufferRange(GLenum target, GLuint index, return; } - if (offset + size >= bufObj->Size) { + if (offset + size > bufObj->Size) { _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(offset + size %d > buffer size %d)", (int) (offset + size), (int) (bufObj->Size));