[Mesa-dev] [PATCH 5/8] mesa: check/assert array index in _mesa_bind_vertex_buffer()

Brian Paul brianp at vmware.com
Mon Jan 29 20:42:51 UTC 2018


---
 src/mesa/main/varray.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index bda1c5a..2801a6f 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -166,6 +166,7 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
                          struct gl_buffer_object *vbo,
                          GLintptr offset, GLsizei stride)
 {
+   assert(index < ARRAY_SIZE(vao->BufferBinding));
    struct gl_vertex_buffer_binding *binding = &vao->BufferBinding[index];
 
    if (binding->BufferObj != vbo ||
-- 
2.7.4



More information about the mesa-dev mailing list