projects
/
tools
/
apitrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c97d2c5
)
Don't overflow the max index when the app isn't rendering anything.
author
Zack Rusin
<zack@kde.org>
Fri, 29 Apr 2011 05:22:59 +0000
(
01:22
-0400)
committer
Zack Rusin
<zack@kde.org>
Fri, 29 Apr 2011 05:22:59 +0000
(
01:22
-0400)
fixes #16
glsize.hpp
patch
|
blob
|
history
diff --git
a/glsize.hpp
b/glsize.hpp
index
9e3bd82
..
838625a
100644
(file)
--- a/
glsize.hpp
+++ b/
glsize.hpp
@@
-94,6
+94,9
@@
__glArrayPointer_size(GLint size, GLenum type, GLsizei stride, GLsizei maxIndex)
static inline GLuint
__glDrawArrays_maxindex(GLint first, GLsizei count)
{
+ if (!count) {
+ return 0;
+ }
return first + count - 1;
}
@@
-102,6
+105,10
@@
__glDrawElements_maxindex(GLsizei count, GLenum type, const GLvoid *indices)
{
GLvoid *temp = 0;
GLint __element_array_buffer = 0;
+
+ if (!count) {
+ return 0;
+ }
__glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &__element_array_buffer);
if (__element_array_buffer) {
// Read indices from index buffer object