From 673f4d0c1dfe78f66e8d7f036c619065800022de Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 21 Jul 2021 13:08:12 -0700 Subject: [PATCH] vrend: fix boundary check for SSBO state update (PIPE_MAX_SHADER_BUFFERS - num_ssbo) can underflow. Signed-off-by: Chia-I Wu Reviewed-by: Yiwei Zhang --- src/vrend_decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vrend_decode.c b/src/vrend_decode.c index 35ccc23..9fc3552 100644 --- a/src/vrend_decode.c +++ b/src/vrend_decode.c @@ -1208,7 +1208,7 @@ static int vrend_decode_set_shader_buffers(struct vrend_context *ctx, const uint return 0; 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; for (uint32_t i = 0; i < num_ssbo; i++) {