From e863541e43997cb701067fdc525f75e99b5b187e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Jan 2018 11:27:33 -0700 Subject: [PATCH] mesa: check/assert array index in _mesa_bind_vertex_buffer() Reviewed-by: Gert Wollny --- 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 bda1c5a3b68..2801a6fa692 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.30.2