mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/dxbc: Validate component types in shader_parse_signature().
This commit is contained in:
Notes:
Henri Verbeet
2025-02-24 16:26:29 +01:00
Approved-by: Conor McCarthy (@cmccarthy) Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1371
@@ -444,7 +444,12 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s
|
||||
}
|
||||
e[i].semantic_index = read_u32(&ptr);
|
||||
e[i].sysval_semantic = read_u32(&ptr);
|
||||
e[i].component_type = read_u32(&ptr);
|
||||
if ((e[i].component_type = read_u32(&ptr)) > VKD3D_SHADER_COMPONENT_FLOAT)
|
||||
{
|
||||
vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_COMPONENT_TYPE,
|
||||
"Element %u has invalid component type %#x.\n", i, e[i].component_type);
|
||||
fail = true;
|
||||
}
|
||||
e[i].register_index = read_u32(&ptr);
|
||||
e[i].target_location = e[i].register_index;
|
||||
e[i].register_count = 1;
|
||||
|
Reference in New Issue
Block a user