From 67722ae403526d8b267e29ed2ac962b806001ce5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 12 Jan 2011 18:12:46 -0700 Subject: 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. --- src/mesa/main/get.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 5d26f74bbc2..196ac5d1201 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 */ -- cgit v1.2.3