From 2405bfc4426b77c1e20ae2446bcf77f93815d32f Mon Sep 17 00:00:00 2001 From: Vadim Girlin Date: Tue, 21 Jun 2011 22:47:49 +0400 Subject: [PATCH] mesa: fix range check in _mesa_validate_DrawElements --- src/mesa/main/api_validate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 2981d42..b98fcb0 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -236,7 +236,7 @@ _mesa_validate_DrawElements(struct gl_context *ctx, if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) { /* use indices in the buffer object */ /* make sure count doesn't go outside buffer bounds */ - if (index_bytes(type, count) > ctx->Array.ElementArrayBufferObj->Size) { + if (indices + index_bytes(type, count) > (GLvoid*)ctx->Array.ElementArrayBufferObj->Size) { _mesa_warning(ctx, "glDrawElements index out of buffer bounds"); return GL_FALSE; } -- 1.7.5.4