d3d10: Validate the data size in parse_fx10() (AFL).

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-05-26 19:36:55 +02:00 committed by Alexandre Julliard
parent 1f38359ec5
commit e36630f702
1 changed files with 6 additions and 0 deletions

View File

@ -2180,6 +2180,12 @@ static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_s
const char *ptr = data;
DWORD unknown;
if (!require_space(0, 19, sizeof(DWORD), data_size))
{
WARN("Invalid data size %#x.\n", data_size);
return E_INVALIDARG;
}
/* Compiled target version (e.g. fx_4_0=0xfeff1001, fx_4_1=0xfeff1011). */
read_dword(&ptr, &e->version);
TRACE("Target: %#x\n", e->version);