From 040a7117c3b404f82a39cf7b2b232a2149ddfeec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 12 Feb 2020 17:15:34 -0500 Subject: [PATCH] st/mesa: fix a possible crash with selection and feedback modes The index bounds are always valid without an index buffer, but they won't be. Reviewed-by: Dave Airlie Tested-by: Marge Bot Part-of: --- src/mesa/state_tracker/st_draw_feedback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 44b7b1e8547..47e43f856d5 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -134,7 +134,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, st_validate_state(st, ST_PIPELINE_RENDER); - if (!index_bounds_valid) + if (ib && !index_bounds_valid) vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index, nr_prims); /* must get these after state validation! */ -- 2.30.2