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>
This commit is contained in:
Henri Verbeet 2017-02-09 12:52:37 +01:00 committed by Alexandre Julliard
parent b28631f62f
commit 6b8cc32a1f
2 changed files with 2 additions and 1 deletions

View File

@ -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);
}

View File

@ -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,