1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 22:54:16 +01:00

[d3d11] Don't allow the creation of buffers with a size of zero

This commit is contained in:
Philip Rebohle 2019-07-21 20:47:42 +02:00
parent f5cec978c8
commit 00cf2a20a3
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -200,6 +200,10 @@ namespace dxvk {
HRESULT D3D11Buffer::ValidateBufferProperties(
const D3D11_BUFFER_DESC* pDesc) {
// Zero-sized buffers are illegal
if (!pDesc->ByteWidth)
return E_INVALIDARG;
// Basic validation for structured buffers
if ((pDesc->MiscFlags & D3D11_RESOURCE_MISC_BUFFER_STRUCTURED)
&& ((pDesc->StructureByteStride == 0)