aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-02-16 13:06:07 +0000
committerEmil Velikov <[email protected]>2017-03-01 13:34:40 +0000
commite1ba82d559a23e0653dda4186c3242c359a03eb2 (patch)
tree4f7f1c781bed2fd1d77f2ee70f15a397042f007a /src
parentb4880ea2ebfc20957b964f4e8fced682c3a59874 (diff)
i965/fs: fix uninitialized memory access
Found while running shader-db under valgrind. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Cc: "13.0 17.0" <[email protected]> (cherry picked from commit a0ac118398c924f2ae75e5649fbaacd95abd231f)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
index f56f05b7e9b..952276faed8 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
@@ -207,9 +207,8 @@ fs_visitor::register_coalesce()
channels_remaining = -1;
continue;
}
- dst_reg_offset[offset] = inst->dst.offset / REG_SIZE;
- if (inst->size_written > REG_SIZE)
- dst_reg_offset[offset + 1] = inst->dst.offset / REG_SIZE + 1;
+ for (unsigned i = 0; i < MAX2(inst->size_written / REG_SIZE, 1); i++)
+ dst_reg_offset[offset + i] = inst->dst.offset / REG_SIZE + i;
mov[offset] = inst;
channels_remaining -= regs_written(inst);
}