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 <airlied@redhat.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3986>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3986>
This commit is contained in:
Marek Olšák 2020-02-12 17:15:34 -05:00
parent 7b0e043d48
commit 040a7117c3

View file

@ -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! */