From 5fa5a012b163bad80d01a65e2947510f15e1be6b Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 4 Sep 2015 08:02:14 +1000 Subject: [PATCH] r600: fix loop overrun in cayman_mul_double_instr Coverity warned about this. Ilia pointed it out. Signed-off-by: Dave Airlie --- src/gallium/drivers/r600/r600_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 9043668a532..78904da13c3 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -3194,7 +3194,7 @@ static int cayman_mul_double_instr(struct r600_shader_ctx *ctx) int lasti = tgsi_last_instruction(inst->Dst[0].Register.WriteMask); int t1 = ctx->temp_reg; - for (k = 0; k <= 2; k++) { + for (k = 0; k < 2; k++) { if (!(inst->Dst[0].Register.WriteMask & (0x3 << (k * 2)))) continue; -- 2.30.2