Mesa (master): nvc0: handle nr being 0 in nvc0_set_global_bindings

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 19 18:33:21 UTC 2020


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

Author: Karol Herbst <kherbst at redhat.com>
Date:   Wed May 20 17:40:28 2020 +0200

nvc0: handle nr being 0 in nvc0_set_global_bindings

Signed-off-by: Karol Herbst <kherbst at redhat.com>
Reviewed-by: Pierre Moreau <dev at pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6367>

---

 src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index 5cb07609dae..076fe1c6dec 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -1379,6 +1379,9 @@ nvc0_set_global_bindings(struct pipe_context *pipe,
    unsigned i;
    const unsigned end = start + nr;
 
+   if (!nr)
+      return;
+
    if (nvc0->global_residents.size <= (end * sizeof(struct pipe_resource *))) {
       const unsigned old_size = nvc0->global_residents.size;
       if (util_dynarray_resize(&nvc0->global_residents, struct pipe_resource *, end)) {



More information about the mesa-commit mailing list