mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 01:38:06 +02:00
radv: avoid oob read during clear
when clearing a depth/stencil image the passed colorvalue pointer is smaller than the VkClearValue struct size Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8288>
This commit is contained in:
parent
33fd9e5d8a
commit
1a7b7b17ad
1 changed files with 6 additions and 1 deletions
|
|
@ -2204,7 +2204,12 @@ radv_cmd_clear_image(struct radv_cmd_buffer *cmd_buffer,
|
||||||
bool cs)
|
bool cs)
|
||||||
{
|
{
|
||||||
VkFormat format = image->vk_format;
|
VkFormat format = image->vk_format;
|
||||||
VkClearValue internal_clear_value = *clear_value;
|
VkClearValue internal_clear_value;
|
||||||
|
|
||||||
|
if (image->aspects & VK_IMAGE_ASPECT_COLOR_BIT)
|
||||||
|
internal_clear_value.color = clear_value->color;
|
||||||
|
else
|
||||||
|
internal_clear_value.depthStencil = clear_value->depthStencil;
|
||||||
|
|
||||||
if (format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32) {
|
if (format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32) {
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue