Module: wine Branch: master Commit: 6b8cc32a1f1b63b4ac7a0924a16cb38d20e06946 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6b8cc32a1f1b63b4ac7a0924a1...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Feb 9 12:52:37 2017 +0100
d3d9: Clear the "surface" pointer on error in d3d9_device_CreateDepthStencilSurfaceEx().
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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,