Mesa (master): cso: check count == 0 in cso_set_vertex_buffers

Marek Olšák mareko at kemper.freedesktop.org
Tue May 15 16:36:47 UTC 2018


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon May 14 22:32:33 2018 -0400

cso: check count == 0 in cso_set_vertex_buffers

The code didn't expect that, leading to crashes.

Fixes: 86d63b53a20a747e "gallium: remove aux_vertex_buffer_slot code"

Tested-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/gallium/auxiliary/cso_cache/cso_context.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index e3d46f3c8d..2543c5ff61 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -1147,6 +1147,9 @@ void cso_set_vertex_buffers(struct cso_context *ctx,
 {
    struct u_vbuf *vbuf = ctx->vbuf;
 
+   if (!count)
+      return;
+
    if (vbuf) {
       u_vbuf_set_vertex_buffers(vbuf, start_slot, count, buffers);
       return;




More information about the mesa-commit mailing list