vkd3d-utils: Check for a NULL 'blob' pointer in D3DCreateBlob().

This commit is contained in:
Henri Verbeet
2023-09-21 16:49:11 +02:00
committed by Alexandre Julliard
parent eaf35c394d
commit 47d4097efa
Notes: Alexandre Julliard 2023-10-16 23:02:26 +02:00
Approved-by: Matteo Bruni (@Mystral)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/405
3 changed files with 34 additions and 0 deletions

View File

@@ -537,6 +537,12 @@ HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob)
TRACE("data_size %lu, blob %p.\n", data_size, blob);
if (!blob)
{
WARN("Invalid 'blob' pointer specified.\n");
return D3DERR_INVALIDCALL;
}
if (!(data = vkd3d_calloc(data_size, 1)))
return E_OUTOFMEMORY;

View File

@@ -31,4 +31,8 @@
#include "vkd3d_memory.h"
#include <vkd3d_utils.h>
#ifndef D3DERR_INVALIDCALL
#define D3DERR_INVALIDCALL _HRESULT_TYPEDEF_(0x8876086c)
#endif
#endif /* __VKD3D_UTILS_PRIVATE_H */