From f75421751782222e724510c7918edfe09ba33c7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 19 Mar 2018 16:51:21 -0400 Subject: [PATCH] st/mesa: don't draw if the bound element array buffer is not allocated MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Tested-by: Dieter Nützel --- src/mesa/state_tracker/st_draw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index e9ffc18d915..8011d0f25ca 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -177,6 +177,13 @@ st_draw_vbo(struct gl_context *ctx, /* indices are in a real VBO */ info.has_user_indices = false; info.index.resource = st_buffer_object(bufobj)->buffer; + + /* Return if the bound element array buffer doesn't have any backing + * storage. (nothing to do) + */ + if (!info.index.resource) + return; + start = pointer_to_offset(ib->ptr) / info.index_size; } else { /* indices are in user space memory */ -- 2.30.2