diff --git a/src/dxgi/dxgi_adapter.cpp b/src/dxgi/dxgi_adapter.cpp index 9ee5a95d..42ffe639 100644 --- a/src/dxgi/dxgi_adapter.cpp +++ b/src/dxgi/dxgi_adapter.cpp @@ -71,6 +71,9 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE DxgiAdapter::GetDesc(DXGI_ADAPTER_DESC* pDesc) { + if (pDesc == nullptr) + return E_INVALIDARG; + DXGI_ADAPTER_DESC1 desc1; HRESULT hr = this->GetDesc1(&desc1); diff --git a/src/dxgi/dxgi_factory.cpp b/src/dxgi/dxgi_factory.cpp index 443eab99..adac98de 100644 --- a/src/dxgi/dxgi_factory.cpp +++ b/src/dxgi/dxgi_factory.cpp @@ -50,8 +50,8 @@ namespace dxvk { IUnknown* pDevice, DXGI_SWAP_CHAIN_DESC* pDesc, IDXGISwapChain** ppSwapChain) { - if (ppSwapChain == nullptr || pDesc == nullptr) - return E_INVALIDARG; + if (ppSwapChain == nullptr || pDesc == nullptr || pDevice == NULL) + return DXGI_ERROR_INVALID_CALL; try { *ppSwapChain = ref(new DxgiSwapChain(this, pDevice, pDesc));