mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
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:
parent
6fe4b7344d
commit
ecfce9f9ad
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue