From e8e57399782397c01a8a744969ae496d0bc47a40 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 3 Mar 2018 23:33:55 +0100 Subject: [PATCH] [d3d11] Fixed potential crashes in InitImage/InitBuffer --- src/d3d11/d3d11_device.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index a8ddab96..4f4c4f1f 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1562,7 +1562,7 @@ namespace dxvk { const DxvkBufferSlice bufferSlice = pBuffer->GetBufferSlice(); - if (pInitialData != nullptr) { + if (pInitialData != nullptr && pInitialData->pSysMem != nullptr) { LockResourceInitContext(); m_resourceInitContext->updateBuffer( @@ -1581,7 +1581,7 @@ namespace dxvk { const D3D11_SUBRESOURCE_DATA* pInitialData) { const DxvkFormatInfo* formatInfo = imageFormatInfo(image->info().format); - if (pInitialData != nullptr) { + if (pInitialData != nullptr && pInitialData->pSysMem != nullptr) { LockResourceInitContext(); // pInitialData is an array that stores an entry for