mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 12:16:14 +01:00
Ex texture loaders updated with additional parameter validation (#142)
This commit is contained in:
@@ -818,7 +818,14 @@ HRESULT DirectX::CreateWICTextureFromMemoryEx(
|
||||
}
|
||||
|
||||
if (!d3dDevice || !wicData || (!texture && !textureView))
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (textureView && !(bindFlags & D3D11_BIND_SHADER_RESOURCE))
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (!wicDataSize)
|
||||
return E_FAIL;
|
||||
@@ -951,7 +958,14 @@ HRESULT DirectX::CreateWICTextureFromFileEx(
|
||||
}
|
||||
|
||||
if (!d3dDevice || !fileName || (!texture && !textureView))
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (textureView && !(bindFlags & D3D11_BIND_SHADER_RESOURCE))
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
auto pWIC = _GetWIC();
|
||||
if (!pWIC)
|
||||
|
||||
Reference in New Issue
Block a user