From a248ae985d54e3cc56d3f27cd3bae6686adf12f0 Mon Sep 17 00:00:00 2001 From: ZeroFault Date: Tue, 17 Apr 2018 05:57:40 -0600 Subject: [PATCH] [d3d11] nullptr check on Begin and End (#295) --- src/d3d11/d3d11_context.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index bc2a8d2c3..3f14e21fe 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -181,6 +181,9 @@ namespace dxvk { void STDMETHODCALLTYPE D3D11DeviceContext::Begin(ID3D11Asynchronous *pAsync) { + if (pAsync == nullptr) + return; + Com query; if (SUCCEEDED(pAsync->QueryInterface(__uuidof(ID3D11Query), reinterpret_cast(&query)))) { @@ -198,8 +201,11 @@ namespace dxvk { void STDMETHODCALLTYPE D3D11DeviceContext::End(ID3D11Asynchronous *pAsync) { + if (pAsync == nullptr) + return; + Com query; - + if (SUCCEEDED(pAsync->QueryInterface(__uuidof(ID3D11Query), reinterpret_cast(&query)))) { Com queryPtr = static_cast(query.ptr());