Commit 67722ae4 authored by Brian Paul's avatar Brian Paul
Browse files

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.
parent 2fa6012f
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment