vkd3d-utils: Return an error from open_include() if a NULL ID3DInclude was passed to D3DPreprocess().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-12-01 20:51:09 -06:00 committed by Alexandre Julliard
parent e1aea0a3af
commit dc7fd3760d

View File

@ -131,6 +131,9 @@ static int open_include(const char *filename, bool local, const char *parent_dat
ID3DInclude *iface = context; ID3DInclude *iface = context;
unsigned int size; unsigned int size;
if (!iface)
return VKD3D_ERROR;
if (FAILED(ID3DInclude_Open(iface, local ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM, if (FAILED(ID3DInclude_Open(iface, local ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM,
filename, parent_data, &code->code, &size))) filename, parent_data, &code->code, &size)))
return VKD3D_ERROR; return VKD3D_ERROR;