mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
zink: do not read outside of array
We need to bounds-check *before* we index the array, otherwise we peek beyond the end of it. Caught by Valgrind. Fixes:dd29a7e5b0("zink: move descriptor barrier handling to main update function") Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10367> (cherry picked from commita6a198da21)
This commit is contained in:
parent
e430e991db
commit
ce04ac4e54
2 changed files with 2 additions and 2 deletions
|
|
@ -94,7 +94,7 @@
|
||||||
"description": "zink: do not read outside of array",
|
"description": "zink: do not read outside of array",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"master_sha": null,
|
"master_sha": null,
|
||||||
"because_sha": "dd29a7e5b0ec289a8de978b5ad44e8fe7d1760ac"
|
"because_sha": "dd29a7e5b0ec289a8de978b5ad44e8fe7d1760ac"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1224,7 +1224,7 @@ zink_descriptors_update(struct zink_context *ctx, struct zink_screen *screen, bo
|
||||||
is_compute, cache_hit[ZINK_DESCRIPTOR_TYPE_IMAGE],
|
is_compute, cache_hit[ZINK_DESCRIPTOR_TYPE_IMAGE],
|
||||||
need_resource_refs[ZINK_DESCRIPTOR_TYPE_IMAGE]);
|
need_resource_refs[ZINK_DESCRIPTOR_TYPE_IMAGE]);
|
||||||
|
|
||||||
for (int h = 0; zds[h] && h < ZINK_DESCRIPTOR_TYPES; h++) {
|
for (int h = 0; h < ZINK_DESCRIPTOR_TYPES && zds[h]; h++) {
|
||||||
/* skip null descriptor sets since they have no resources */
|
/* skip null descriptor sets since they have no resources */
|
||||||
if (!zds[h]->hash)
|
if (!zds[h]->hash)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue