From 04586f6328f6d8040b8ecf34fea50e1761d7cfac Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 10 Feb 2017 13:58:56 +0100 Subject: [PATCH] d3d8: Do not modify the "surface" pointer for D3DFMT_UNKNOWN in d3d8_device_CreateDepthStencilSurface(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d8/device.c | 3 +++ dlls/d3d8/tests/device.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index f8eb7ee305b..95923423733 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1010,6 +1010,9 @@ static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface(IDirect3DDevice8 *if TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, surface %p.\n", iface, width, height, format, multisample_type, surface); + if (!format) + return D3DERR_INVALIDCALL; + *surface = NULL; /* TODO: Verify that Discard is false */ diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 2295300b19a..45969fe366a 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -8218,7 +8218,7 @@ static void test_format_unknown(void) hr = IDirect3DDevice8_CreateDepthStencilSurface(device, 64, 64, D3DFMT_UNKNOWN, D3DMULTISAMPLE_NONE, (IDirect3DSurface8 **)&iface); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - todo_wine ok(iface == (void *)0xdeadbeef, "Got unexpected iface %p.\n", iface); + ok(iface == (void *)0xdeadbeef, "Got unexpected iface %p.\n", iface); iface = (void *)0xdeadbeef; hr = IDirect3DDevice8_CreateImageSurface(device, 64, 64,