diff options
author | Brian Paul <brianp@vmware.com> | 2011-01-12 18:12:46 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2011-01-12 18:13:18 -0700 |
commit | 67722ae403526d8b267e29ed2ac962b806001ce5 (patch) | |
tree | fe32425126a31586a13baa97279ae3a08dcf15ff | |
parent | 2fa6012f6a0b02de6093cbccba3bf4432f072e57 (diff) |
mesa: don't assert in GetIntegerIndexed, etc
We were getting an assertion upon invalid pname.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
-rw-r--r-- | src/mesa/main/get.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 5d26f74bbc..196ac5d120 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -2311,8 +2311,10 @@ void GLAPIENTRY _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params ) { union value v; + enum value_type type = + find_value_indexed("glGetBooleanIndexedv", pname, index, &v); - switch (find_value_indexed("glGetBooleanIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = INT_TO_BOOLEAN(v.value_int); break; @@ -2326,7 +2328,7 @@ _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params ) params[0] = INT64_TO_BOOLEAN(v.value_int); break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } @@ -2334,8 +2336,10 @@ void GLAPIENTRY _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params ) { union value v; + enum value_type type = + find_value_indexed("glGetIntegerIndexedv", pname, index, &v); - switch (find_value_indexed("glGetIntegerIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = v.value_int; break; @@ -2349,7 +2353,7 @@ _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params ) params[0] = INT64_TO_INT(v.value_int); break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } @@ -2358,8 +2362,10 @@ void GLAPIENTRY _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) { union value v; + enum value_type type = + find_value_indexed("glGetIntegerIndexedv", pname, index, &v); - switch (find_value_indexed("glGetIntegerIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = v.value_int; break; @@ -2373,7 +2379,7 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) params[0] = v.value_int; break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } #endif /* FEATURE_ARB_sync */ |