[Mesa-dev] [PATCH 22/22] mesa: check for invalid index on UUID glGet queries

Andres Rodriguez andresx7 at gmail.com
Fri Dec 22 00:41:57 UTC 2017


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 34970b8..302cece 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.9.3



More information about the mesa-dev mailing list