mesa: check/assert array index in _mesa_bind_vertex_buffer()
authorBrian Paul <brianp@vmware.com>
Fri, 26 Jan 2018 18:27:33 +0000 (11:27 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 30 Jan 2018 16:07:59 +0000 (09:07 -0700)
Reviewed-by: Gert Wollny <gw.fossdev@gmail.com>
src/mesa/main/varray.c

index bda1c5a3b6855cb8c15591169b981b397dae7b10..2801a6fa692052d5d3d28ec68c088d40bd463c5b 100644 (file)
@@ -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 ||