d3d10/effect: Validate preshader blob size for index expressions.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2021-12-10 20:03:37 +01:00 committed by Alexandre Julliard
parent 1c7323b192
commit 921bade0da
1 changed files with 6 additions and 0 deletions

View File

@ -2633,6 +2633,12 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size
data_ptr = data + code_offset;
read_dword(&data_ptr, &blob_size);
if (!require_space(code_offset, 1, sizeof(uint32_t) + blob_size, data_size))
{
WARN("Invalid offset %#x (data size %#lx).\n", code_offset, (long)data_size);
return E_FAIL;
}
dep.id = id;
dep.idx = idx;
dep.operation = operation;