r600: fix loop overrun in cayman_mul_double_instr
authorDave Airlie <airlied@redhat.com>
Thu, 3 Sep 2015 22:02:14 +0000 (08:02 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 3 Sep 2015 22:02:14 +0000 (08:02 +1000)
Coverity warned about this. Ilia pointed it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_shader.c

index 9043668a532b30a9372ca243d5c2c0bfad3007fc..78904da13c3e9c1957b9fd82bd85c4c7bf1fa71a 100644 (file)
@@ -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;