Commit a9895eaf authored by Marcin Ślusarz's avatar Marcin Ślusarz Committed by Eric Engestrom
Browse files

intel/vec4: fix out of bounds read

NIR_MAX_VEC_COMPONENTS was bumped from 4 to 16 in a8ec4082
(2019.03.09, merged 2019.12.21)

float[4] array was added in acd7796a
(2019.06.11, merged 2019.07.11)

Found by Coverity.
Closes: #3014

Signed-off-by: Marcin Ślusarz's avatarMarcin Ślusarz <marcin.slusarz@intel.com>
Fixes: a8ec4082

 ("nir+vtn: vec8+vec16 support")
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <!6067>
(cherry picked from commit cb19fe24)
parent d3020027
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
"description": "intel/vec4: fix out of bounds read", "description": "intel/vec4: fix out of bounds read",
"nominated": true, "nominated": true,
"nomination_type": 1, "nomination_type": 1,
"resolution": 0, "resolution": 1,
"master_sha": null, "master_sha": null,
"because_sha": "a8ec4082a41830cf67a4fd405402fd2d820722fd" "because_sha": "a8ec4082a41830cf67a4fd405402fd2d820722fd"
}, },
...@@ -997,7 +997,7 @@ try_immediate_source(const nir_alu_instr *instr, src_reg *op, ...@@ -997,7 +997,7 @@ try_immediate_source(const nir_alu_instr *instr, src_reg *op,
case BRW_REGISTER_TYPE_F: { case BRW_REGISTER_TYPE_F: {
int first_comp = -1; int first_comp = -1;
float f[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; float f[NIR_MAX_VEC_COMPONENTS] = { 0.0f };
bool is_scalar = true; bool is_scalar = true;
for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++) { for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment