summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorStéphane Marchesin <[email protected]>2013-09-06 10:45:27 -0700
committerStéphane Marchesin <[email protected]>2013-09-06 11:05:24 -0700
commit7125af295751c504063644f61f19c0d70a6b1b3e (patch)
tree96db74816aaec2d71b1299e56f62465f2cceee23 /src/gallium/drivers
parentac8448dd9779478b570ef15f7232cfcf22f2d3db (diff)
i915g: Fix initial array index
Fixes "Out-of-bounds read" defect reported by Coverity.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/i915/i915_state_emit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c
index 9c16e590003..71ac326c4d8 100644
--- a/src/gallium/drivers/i915/i915_state_emit.c
+++ b/src/gallium/drivers/i915/i915_state_emit.c
@@ -142,7 +142,7 @@ static uint target_fixup(struct pipe_surface *p, int component)
{ PIPE_FORMAT_A8_UNORM, { 0, 0, 0, S5_WRITEDISABLE_RED | S5_WRITEDISABLE_GREEN | S5_WRITEDISABLE_BLUE | S5_WRITEDISABLE_ALPHA}},
{ 0, { S5_WRITEDISABLE_RED, S5_WRITEDISABLE_GREEN, S5_WRITEDISABLE_BLUE, S5_WRITEDISABLE_ALPHA}}
};
- int i = sizeof(fixup_mask) / sizeof(*fixup_mask);
+ int i = sizeof(fixup_mask) / sizeof(*fixup_mask) - 1;
if (p)
for(i = 0; fixup_mask[i].format != 0; i++)