mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader: Add compiler messages for invalid DXBC chunk offsets and sizes.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
29e9cf032c
commit
29287d3368
@ -2015,6 +2015,8 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
|
||||
if (chunk_offset >= data_size || !require_space(chunk_offset, 2, sizeof(DWORD), data_size))
|
||||
{
|
||||
WARN("Invalid chunk offset %#x (data size %zu).\n", chunk_offset, data_size);
|
||||
vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_OFFSET,
|
||||
"DXBC chunk %u has invalid offset %#x (data size %#zx).", i, chunk_offset, data_size);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
@ -2027,6 +2029,9 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
|
||||
{
|
||||
WARN("Invalid chunk size %#x (data size %zu, chunk offset %#x).\n",
|
||||
chunk_size, data_size, chunk_offset);
|
||||
vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_SIZE,
|
||||
"DXBC chunk %u has invalid size %#x (data size %#zx, chunk offset %#x).",
|
||||
i, chunk_offset, data_size, chunk_offset);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,8 @@ enum vkd3d_shader_error
|
||||
VKD3D_SHADER_ERROR_DXBC_INVALID_MAGIC = 2,
|
||||
VKD3D_SHADER_ERROR_DXBC_INVALID_CHECKSUM = 3,
|
||||
VKD3D_SHADER_ERROR_DXBC_INVALID_VERSION = 4,
|
||||
VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_OFFSET = 5,
|
||||
VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_SIZE = 6,
|
||||
};
|
||||
|
||||
enum VKD3D_SHADER_INSTRUCTION_HANDLER
|
||||
|
Loading…
Reference in New Issue
Block a user