mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 04:16:12 +01:00
Ex texture loaders updated with additional parameter validation (#142)
This commit is contained in:
@@ -1776,6 +1776,11 @@ HRESULT DirectX::CreateDDSTextureFromMemoryEx(
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (textureView && !(bindFlags & D3D11_BIND_SHADER_RESOURCE))
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
// Validate DDS file in memory
|
||||
const DDS_HEADER* header = nullptr;
|
||||
const uint8_t* bitData = nullptr;
|
||||
@@ -1906,6 +1911,11 @@ HRESULT DirectX::CreateDDSTextureFromFileEx(
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (textureView && !(bindFlags & D3D11_BIND_SHADER_RESOURCE))
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
const DDS_HEADER* header = nullptr;
|
||||
const uint8_t* bitData = nullptr;
|
||||
size_t bitSize = 0;
|
||||
|
||||
Reference in New Issue
Block a user