vrend: Avoid potential null dereference when drawing with indexed buffer

Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
macos/master
David Riley 5 years ago committed by David Riley
parent 271db8a24b
commit c5a2df90a2
  1. 4
      src/vrend_renderer.c

@ -4264,6 +4264,10 @@ int vrend_draw_vbo(struct vrend_context *ctx,
if (info->indexed) {
struct vrend_resource *res = (struct vrend_resource *)ctx->sub->ib.buffer;
if (!res) {
vrend_printf( "VBO missing indexed array buffer\n");
return 0;
}
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, res->id);
} else
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

Loading…
Cancel
Save