diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 617c4670..5b81d179 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -164,6 +164,11 @@ namespace dxvk { void* pData, UINT DataSize, UINT GetDataFlags) { + // Make sure that we can safely write to the memory + // location pointed to by pData if it is specified. + if (DataSize == 0) + pData = nullptr; + if (pData != nullptr && pAsync->GetDataSize() != DataSize) { Logger::err(str::format("D3D11DeviceContext: GetData: Data size mismatch: ", pAsync->GetDataSize(), ",", DataSize)); return E_INVALIDARG;