projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'mesa_7_7_branch'
[mesa.git]
/
src
/
mesa
/
vbo
/
vbo_exec_array.c
diff --git
a/src/mesa/vbo/vbo_exec_array.c
b/src/mesa/vbo/vbo_exec_array.c
index fd70b57b72edb67d97762169dd344859af83f5fe..bd2fccdba1456fb5a8b79f48d26cb8c9e5b84718 100644
(file)
--- a/
src/mesa/vbo/vbo_exec_array.c
+++ b/
src/mesa/vbo/vbo_exec_array.c
@@
-35,7
+35,6
@@
#include "main/bufferobj.h"
#include "main/enums.h"
#include "main/macros.h"
#include "main/bufferobj.h"
#include "main/enums.h"
#include "main/macros.h"
-#include "glapi/dispatch.h"
#include "vbo_context.h"
#include "vbo_context.h"
@@
-146,7
+145,7
@@
check_array_data(GLcontext *ctx, struct gl_client_array *array,
array->Ptr, array->BufferObj->Name);
f[k] = 1.0; /* XXX replace the bad value! */
}
array->Ptr, array->BufferObj->Name);
f[k] = 1.0; /* XXX replace the bad value! */
}
- /
/assert(!IS_INF_OR_NAN(f[k]));
+ /
*assert(!IS_INF_OR_NAN(f[k]));*/
}
}
break;
}
}
break;
@@
-689,6
+688,16
@@
vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
* or we can read/write out of memory in several different places!
*/
* or we can read/write out of memory in several different places!
*/
+ /* Catch/fix some potential user errors */
+ if (type == GL_UNSIGNED_BYTE) {
+ start = MIN2(start, 0xff);
+ end = MIN2(end, 0xff);
+ }
+ else if (type == GL_UNSIGNED_SHORT) {
+ start = MIN2(start, 0xffff);
+ end = MIN2(end, 0xffff);
+ }
+
if (end >= ctx->Array.ArrayObj->_MaxElement) {
/* the max element is out of bounds of one or more enabled arrays */
warnCount++;
if (end >= ctx->Array.ArrayObj->_MaxElement) {
/* the max element is out of bounds of one or more enabled arrays */
warnCount++;
@@
-739,6
+748,10
@@
vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
*/
}
#endif
*/
}
#endif
+
+ /* Set 'end' to the max possible legal value */
+ assert(ctx->Array.ArrayObj->_MaxElement >= 1);
+ end = ctx->Array.ArrayObj->_MaxElement - 1;
}
else if (0) {
_mesa_printf("glDraw[Range]Elements{,BaseVertex}"
}
else if (0) {
_mesa_printf("glDraw[Range]Elements{,BaseVertex}"