i965: Fix out-of-bounds access to brw_stage_state::surf_offset
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Fri, 27 Mar 2020 14:55:52 +0000 (16:55 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 16:09:20 +0000 (16:09 +0000)
commit784358bd6e6d59c521133c2a31fa9b88f8e18598
tree0182df79b76eca1c83d58066f8bcc7b9d8ccef5b
parent7f6a491eec02d6c141e2b4849a3ba924926a482a
i965: Fix out-of-bounds access to brw_stage_state::surf_offset

../src/mesa/drivers/dri/i965/brw_wm_surface_state.c:1378:32: runtime error: index 3503345872 out of bounds for type 'uint32_t [149]'

brw_assign_common_binding_table_offsets has the following comment:
 "Unused groups are initialized to 0xd0d0d0d0 to make it obvious that they're
 unused but also make sure that addition of small offsets to them will
 trigger some of our asserts that surface indices are < BRW_MAX_SURFACES."

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4350>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c