diff options
author | Brian <[email protected]> | 2007-07-08 09:20:42 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-07-08 09:20:42 -0600 |
commit | 37ece4df7c654b30b6720044b35a83694d7e5bb3 (patch) | |
tree | 076e1199e16fe7deec2ff74c9d86c4f0732adb0f /src/mesa/main | |
parent | 25cfb68f0b3baf0e74d1f6a37afab46370f6711b (diff) |
Check if 'indices' parameter is NULL (bug 11314)
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/api_validate.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 3d20ba7d144..841c6a53026 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 7.0.1 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -100,6 +100,11 @@ _mesa_validate_DrawElements(GLcontext *ctx, (const GLubyte *) indices); } } + else { + /* not using a VBO */ + if (!indices) + return GL_FALSE; + } if (ctx->Const.CheckArrayBounds) { /* find max array index */ @@ -170,6 +175,16 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, && !(ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled)) return GL_FALSE; + /* Vertex buffer object tests */ + if (ctx->Array.ElementArrayBufferObj->Name) { + /* XXX re-use code from above? */ + } + else { + /* not using VBO */ + if (!indices) + return GL_FALSE; + } + if (ctx->Const.CheckArrayBounds) { /* Find max array index. * We don't trust the user's start and end values. |