d3dcompiler: Add argument check in D3DReflect().

This commit is contained in:
Rico Schüller 2011-02-15 19:07:47 +01:00 committed by Alexandre Julliard
parent f8da57ca89
commit 14d8b51bac
1 changed files with 13 additions and 0 deletions

View File

@ -128,9 +128,22 @@ HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void
{
struct d3dcompiler_shader_reflection *object;
HRESULT hr;
const DWORD *temp = data;
TRACE("data %p, data_size %lu, riid %s, blob %p\n", data, data_size, debugstr_guid(riid), reflector);
if (!data || data_size < 32)
{
WARN("Invalid argument supplied.\n");
return D3DERR_INVALIDCALL;
}
if (temp[6] != data_size)
{
WARN("Wrong size supplied.\n");
return E_FAIL;
}
if (!IsEqualGUID(riid, &IID_ID3D11ShaderReflection))
{
WARN("Wrong riid %s, accept only %s!\n", debugstr_guid(riid), debugstr_guid(&IID_ID3D11ShaderReflection));