[Mesa-dev] [RFC] radeonsi: guard against indexbuf not being set

Roman Gilg subdiff at gmail.com
Mon Mar 5 21:31:00 UTC 2018


Fixes crashes of clients when index_size != 0, but there was no indexbuf
set in si_draw_vbo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103234

Signed-off-by: Roman Gilg <subdiff at gmail.com>
---
 src/gallium/drivers/radeonsi/si_state_draw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index ad470fd..e53da38 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -680,7 +680,7 @@ static void si_emit_draw_packets(struct si_context *sctx,
 	}
 
 	/* draw packet */
-	if (index_size) {
+	if (index_size && indexbuf) {
 		if (index_size != sctx->last_index_size) {
 			unsigned index_type;
 
-- 
2.7.4



More information about the mesa-dev mailing list