[PATCH 4/5] d3d11: Set context to NULL in CreateDeferredContext() stub.

Matteo Bruni mbruni at codeweavers.com
Mon Sep 30 16:11:15 CDT 2019


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
Applications often times don't check the return value of
CreateDeferredContext() and might or might not check the returned
pointer. I'd argue that crashing with a NULL pointer exception is
better than executing random code or getting inconsistent behavior
depending on the pointer's uninitialized content.

 dlls/d3d11/device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 5fac1172ca9..212881a9b71 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3358,6 +3358,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device
 {
     FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context);
 
+    *context = NULL;
     return E_NOTIMPL;
 }
 
-- 
2.21.0




More information about the wine-devel mailing list