mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
Check if 'indices' is NULL, bug 11314
This commit is contained in:
parent
9fa3bbcb5a
commit
d65110f352
1 changed files with 17 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue