From 080bee33da1866f4fa00de9197ec15d3fff5722c Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 20 May 2020 17:40:28 +0200 Subject: [PATCH] nvc0: handle nr being 0 in nvc0_set_global_bindings Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau Part-of: --- 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)) { -- 2.30.2