mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader: Assert that we don't read out of bounds of the base_types array.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
35105d4e29
commit
8d444ebbfc
@ -675,14 +675,17 @@ struct vkd3d_string_buffer *hlsl_type_to_string(struct vkd3d_string_buffer_cache
|
||||
switch (type->type)
|
||||
{
|
||||
case HLSL_CLASS_SCALAR:
|
||||
assert(type->base_type < ARRAY_SIZE(base_types));
|
||||
vkd3d_string_buffer_printf(string, "%s", base_types[type->base_type]);
|
||||
return string;
|
||||
|
||||
case HLSL_CLASS_VECTOR:
|
||||
assert(type->base_type < ARRAY_SIZE(base_types));
|
||||
vkd3d_string_buffer_printf(string, "%s%u", base_types[type->base_type], type->dimx);
|
||||
return string;
|
||||
|
||||
case HLSL_CLASS_MATRIX:
|
||||
assert(type->base_type < ARRAY_SIZE(base_types));
|
||||
vkd3d_string_buffer_printf(string, "%s%ux%u", base_types[type->base_type], type->dimx, type->dimy);
|
||||
return string;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user