vrend: fix boundary check for SSBO state update

(PIPE_MAX_SHADER_BUFFERS - num_ssbo) can underflow.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
macos/master
Chia-I Wu 3 years ago
parent 029303e9fd
commit 673f4d0c1d
  1. 2
      src/vrend_decode.c

@ -1208,7 +1208,7 @@ static int vrend_decode_set_shader_buffers(struct vrend_context *ctx, const uint
return 0; return 0;
if (start_slot > PIPE_MAX_SHADER_BUFFERS || if (start_slot > PIPE_MAX_SHADER_BUFFERS ||
start_slot > PIPE_MAX_SHADER_BUFFERS - num_ssbo) num_ssbo > PIPE_MAX_SHADER_BUFFERS - start_slot)
return EINVAL; return EINVAL;
for (uint32_t i = 0; i < num_ssbo; i++) { for (uint32_t i = 0; i < num_ssbo; i++) {

Loading…
Cancel
Save