From 77844e2a0efb6e1a1c8320e2b7b01a9d01f0213f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 15 Sep 2015 01:37:39 +0200 Subject: [PATCH] d3d11: Set output parameters to NULL when D3D11CreateDevice() fails. --- dlls/d3d11/d3d11_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/d3d11/d3d11_main.c b/dlls/d3d11/d3d11_main.c index 40c4a5f5b1f..bce5e9792b5 100644 --- a/dlls/d3d11/d3d11_main.c +++ b/dlls/d3d11/d3d11_main.c @@ -157,6 +157,13 @@ HRESULT WINAPI D3D11CreateDevice(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_t adapter, debug_d3d_driver_type(driver_type), swrast, flags, feature_levels, levels, sdk_version, device_out, obtained_feature_level, immediate_context); + if (device_out) + *device_out = NULL; + if (obtained_feature_level) + *obtained_feature_level = 0; + if (immediate_context) + *immediate_context = NULL; + if (adapter) { IDXGIAdapter_AddRef(adapter);