[PATCH 3/6] d3d9: Clear the "surface" pointer on error in d3d9_device_CreateDepthStencilSurfaceEx().

Henri Verbeet hverbeet at codeweavers.com
Thu Feb 9 05:52:37 CST 2017


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/d3d9/device.c       | 1 +
 dlls/d3d9/tests/d3d9ex.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index e646cb7..ec1b985 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -3474,6 +3474,7 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex
     if (discard)
         flags |= WINED3D_TEXTURE_CREATE_DISCARD;
 
+    *surface = NULL;
     return d3d9_device_create_surface(device, width, height, format, flags, surface,
             D3DUSAGE_DEPTHSTENCIL | usage, D3DPOOL_DEFAULT, multisample_type, multisample_quality, NULL);
 }
diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c
index 6348ee7..1dbab26 100644
--- a/dlls/d3d9/tests/d3d9ex.c
+++ b/dlls/d3d9/tests/d3d9ex.c
@@ -3739,7 +3739,7 @@ static void test_format_unknown(void)
     hr = IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(device, 64, 64,
             D3DFMT_UNKNOWN, D3DMULTISAMPLE_NONE, 0, TRUE, (IDirect3DSurface9 **)&iface, NULL, 0);
     ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
-    todo_wine ok(!iface, "Got unexpected iface %p.\n", iface);
+    ok(!iface, "Got unexpected iface %p.\n", iface);
 
     iface = (void *)0xdeadbeef;
     hr = IDirect3DDevice9Ex_CreateOffscreenPlainSurface(device, 64, 64,
-- 
2.1.4




More information about the wine-patches mailing list