Mesa (master): st/mesa: fix a possible crash with selection and feedback modes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 10 02:04:48 UTC 2020


Module: Mesa
Branch: master
Commit: 040a7117c3b404f82a39cf7b2b232a2149ddfeec
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=040a7117c3b404f82a39cf7b2b232a2149ddfeec

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Feb 12 17:15:34 2020 -0500

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 at 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>

---

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



More information about the mesa-commit mailing list