mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-27 08:50:49 +02:00
freedreno/rnndec: Consider array length when finding by reg name
Otherwise we get a valid reg base for reg array with OOB index. Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31632>
This commit is contained in:
parent
0007077c11
commit
e2e9dd4f21
1 changed files with 2 additions and 0 deletions
|
|
@ -514,6 +514,8 @@ static unsigned tryreg(struct rnndeccontext *ctx, struct rnndelem **elems, int e
|
|||
assert(suffix);
|
||||
ret = tryreg(ctx, elem->subelems, elem->subelemsnum, dwidth, child, offset);
|
||||
if (ret) {
|
||||
if (idx >= elem->length)
|
||||
return 0;
|
||||
*offset += elem->offset + (idx * elem->stride);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue