mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 13:00:21 +01:00
v3dv: duplicate key for texel_buffer cache
We can't use the local variable key to insert in the hashtable, as the key needs to be persistent for future searches. This makes a copy of the key in the pipeline, which is kept persistent in the hashtable. This fixes a stack-buffer-overflow. Backport-to: 25.0 Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33630>
This commit is contained in:
parent
5980d60cf1
commit
eb8017ca68
1 changed files with 2 additions and 1 deletions
|
|
@ -2535,8 +2535,9 @@ get_copy_texel_buffer_pipeline(
|
|||
goto fail;
|
||||
|
||||
if (device->instance->meta_cache_enabled) {
|
||||
memcpy((*pipeline)->key, key, sizeof((*pipeline)->key));
|
||||
_mesa_hash_table_insert(device->meta.texel_buffer_copy.cache[image_type],
|
||||
key, *pipeline);
|
||||
&(*pipeline)->key, *pipeline);
|
||||
mtx_unlock(&device->meta.mtx);
|
||||
} else {
|
||||
v3dv_cmd_buffer_add_private_obj(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue