mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
llvmpipe: fix use after free with fs variant cleanup
item->base will be freed for the NULL reference write so just use a temporary to avoid it. This was found with asan and lavapipe: dEQP-VK.api.copy_and_blit.core.blit_image* Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8912>
This commit is contained in:
parent
2937f69cc0
commit
c10b785490
1 changed files with 2 additions and 1 deletions
|
|
@ -4235,7 +4235,8 @@ llvmpipe_update_fs(struct llvmpipe_context *lp)
|
|||
assert(item);
|
||||
assert(item->base);
|
||||
llvmpipe_remove_shader_variant(lp, item->base);
|
||||
lp_fs_variant_reference(lp, &item->base, NULL);
|
||||
struct lp_fragment_shader_variant *variant = item->base;
|
||||
lp_fs_variant_reference(lp, &variant, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue