blorp: Fix potential read of uninitaized elk fields in debug paths
The intel_vue_map is only partially initialized before being used. All used fields are initialized, but in debug paths the unitialzed fields will also be read. To fix this initialize the struct to 0. In the brw path this struct is part of the prog_data, and is rzalloc'd. CID: 1665308 Reviewed-by: Iván Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37261>
This commit is contained in:
@@ -232,7 +232,8 @@ blorp_ensure_sf_program_elk(struct blorp_batch *batch,
|
||||
const unsigned *program;
|
||||
unsigned program_size;
|
||||
|
||||
struct intel_vue_map vue_map;
|
||||
/* Some fields that are not set can be read in debug paths, so initialization is required */
|
||||
struct intel_vue_map vue_map = {0};
|
||||
elk_compute_vue_map(compiler->devinfo, &vue_map, slots_valid,
|
||||
INTEL_VUE_LAYOUT_FIXED, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user