From 61ce7022e2e1218b136328a852e2c938b4287ab8 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 7 Feb 2018 12:35:40 +0100 Subject: [PATCH] [d3d11] Fix optional write issue in GetData() --- src/d3d11/d3d11_context.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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;