From: Marek Olšák Date: Wed, 12 Feb 2020 22:15:34 +0000 (-0500) Subject: st/mesa: fix a possible crash with selection and feedback modes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=040a7117c3b404f82a39cf7b2b232a2149ddfeec;p=mesa.git 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: --- 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! */