From e36630f7025b749eb3dc120f6495dd1235ed609f Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 26 May 2016 19:36:55 +0200 Subject: [PATCH] d3d10: Validate the data size in parse_fx10() (AFL). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d10/effect.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 971e1c380db..2eb0680e55d 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -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);