summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_array_api.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-10-22 22:59:07 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-10-22 22:59:07 +0000
commitc5b1e81de48de5d8830bf5d92ff767ad1985e46e (patch)
tree169c3c09cdc4e69badfb46540db39439bc2d0ef4 /src/mesa/tnl/t_array_api.c
parent15c37348a5d47ece17ffef38978aa8253363e6ee (diff)
Initial work for bounds checking of vertex arrays and vertex buffer objects.
Only glDrawArrays() done so far. Simplified glVertex/Color/etcPointer functions. Misc casts added here and there.
Diffstat (limited to 'src/mesa/tnl/t_array_api.c')
-rw-r--r--src/mesa/tnl/t_array_api.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c
index 85fada8c28..4f6cb7ef14 100644
--- a/src/mesa/tnl/t_array_api.c
+++ b/src/mesa/tnl/t_array_api.c
@@ -268,7 +268,11 @@ _tnl_DrawRangeElements(GLenum mode,
if (ctx->Array.ElementArrayBufferObj->Name) {
/* use indices in the buffer object */
- ASSERT(ctx->Array.ElementArrayBufferObj->Data);
+ if (!ctx->Array.ElementArrayBufferObj->Data) {
+ _mesa_warning(ctx,
+ "DrawRangeElements with empty vertex elements buffer!");
+ return;
+ }
indices = (GLuint *) ctx->Array.ElementArrayBufferObj->Data;
}
@@ -341,7 +345,10 @@ _tnl_DrawElements(GLenum mode, GLsizei count, GLenum type,
if (ctx->Array.ElementArrayBufferObj->Name) {
/* use indices in the buffer object */
- ASSERT(ctx->Array.ElementArrayBufferObj->Data);
+ if (!ctx->Array.ElementArrayBufferObj->Data) {
+ _mesa_warning(ctx, "DrawElements with empty vertex elements buffer!");
+ return;
+ }
indices = (const GLvoid *) ctx->Array.ElementArrayBufferObj->Data;
}