From: Karol Herbst Date: Wed, 20 May 2020 15:40:28 +0000 (+0200) Subject: nvc0: handle nr being 0 in nvc0_set_global_bindings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=080bee33da1866f4fa00de9197ec15d3fff5722c;p=mesa.git nvc0: handle nr being 0 in nvc0_set_global_bindings Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau Part-of: --- 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)) {