Mesa (master): mesa: check for invalid index on UUID glGet queries

Andres Rodriguez lostgoat at kemper.freedesktop.org
Tue Jan 30 20:20:03 UTC 2018


Module: Mesa
Branch: master
Commit: 0a89784bcc988d602bbe8b310aca8c54ef03d954
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a89784bcc988d602bbe8b310aca8c54ef03d954

Author: Andres Rodriguez <andresx7 at gmail.com>
Date:   Thu Dec 21 19:18:59 2017 -0500

mesa: check for invalid index on UUID glGet queries

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>
Reviewed-by: Marek Olšák <marek.olsak at amd.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 1e4b8f6f0b..cf9a2f66d2 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2578,9 +2578,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;
    }




More information about the mesa-commit mailing list