mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d-shader: Validate the DXBC version.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
12ca2bbcf6
commit
2d8e2fbe86
@ -1814,6 +1814,7 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
|
||||
DWORD chunk_count;
|
||||
DWORD total_size;
|
||||
unsigned int i;
|
||||
DWORD version;
|
||||
DWORD tag;
|
||||
|
||||
read_dword(&ptr, &tag);
|
||||
@ -1828,7 +1829,13 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
|
||||
WARN("Ignoring DXBC checksum.\n");
|
||||
skip_dword_unknown(&ptr, 4);
|
||||
|
||||
skip_dword_unknown(&ptr, 1); /* It seems to always be 0x00000001. */
|
||||
read_dword(&ptr, &version);
|
||||
TRACE("version: %#x.\n", version);
|
||||
if (version != 0x00000001)
|
||||
{
|
||||
WARN("Got unexpected DXBC version %#x.\n", version);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
read_dword(&ptr, &total_size);
|
||||
TRACE("total size: %#x\n", total_size);
|
||||
|
Loading…
Reference in New Issue
Block a user