mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07: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:
committed by
Alexandre Julliard
parent
12ca2bbcf6
commit
2d8e2fbe86
@@ -1814,6 +1814,7 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
|
|||||||
DWORD chunk_count;
|
DWORD chunk_count;
|
||||||
DWORD total_size;
|
DWORD total_size;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
DWORD version;
|
||||||
DWORD tag;
|
DWORD tag;
|
||||||
|
|
||||||
read_dword(&ptr, &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");
|
WARN("Ignoring DXBC checksum.\n");
|
||||||
skip_dword_unknown(&ptr, 4);
|
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);
|
read_dword(&ptr, &total_size);
|
||||||
TRACE("total size: %#x\n", total_size);
|
TRACE("total size: %#x\n", total_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user