nir: Fix out-of-bounds access in ntt_emit_store_output()
This patch resolves the problem by modifying the for loop condition to ensure that it stays within the bounds of the array (i.e., i < 4) Signed-off-by: Cong Liu <liucong2@kylinos.cn> Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25446>
This commit is contained in:
@@ -2349,7 +2349,7 @@ ntt_emit_store_output(struct ntt_compile *c, nir_intrinsic_instr *instr)
|
||||
}
|
||||
|
||||
uint8_t swizzle[4] = { 0, 0, 0, 0 };
|
||||
for (int i = frac; i <= 4; i++) {
|
||||
for (int i = frac; i < 4; i++) {
|
||||
if (out.WriteMask & (1 << i))
|
||||
swizzle[i] = i - frac;
|
||||
}
|
||||
|
Reference in New Issue
Block a user