[Mesa-dev] [PATCH 20/20] mesa: check for invalid index on UUID glGet queries
Andres Rodriguez
andresx7 at gmail.com
Tue Jan 23 18:05:10 UTC 2018
This fixes the piglit test:
spec/ext_semaphore/api-errors/usigned-byte-i-v-bad-value
Signed-off-by: Andres Rodriguez <andresx7 at gmail.com>
---
src/mesa/main/get.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 34970b8e16..302cece3ef 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2547,9 +2547,13 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
v->value_int = 1;
return TYPE_INT;
case GL_DRIVER_UUID_EXT:
+ if (index >= 1)
+ goto invalid_value;
_mesa_get_driver_uuid(ctx, v->value_int_4);
return TYPE_INT_4;
case GL_DEVICE_UUID_EXT:
+ if (index >= 1)
+ goto invalid_value;
_mesa_get_device_uuid(ctx, v->value_int_4);
return TYPE_INT_4;
}
--
2.14.1
More information about the mesa-dev
mailing list