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:
committed by
Marge Bot
parent
0007077c11
commit
e2e9dd4f21
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user