Henri Verbeet : d3d8: Do not modify the "surface" pointer for D3DFMT_UNKNOWN in d3d8_device_CreateRenderTarget().

Alexandre Julliard julliard at winehq.org
Fri Feb 10 16:02:24 CST 2017


Module: wine
Branch: master
Commit: 177b3fc7c1ff5e2e85f8928c33fa5a597548cbfb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=177b3fc7c1ff5e2e85f8928c33fa5a597548cbfb

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Feb 10 13:58:55 2017 +0100

d3d8: Do not modify the "surface" pointer for D3DFMT_UNKNOWN in d3d8_device_CreateRenderTarget().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 fe2f54e..f8eb7ee 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -990,6 +990,9 @@ static HRESULT WINAPI d3d8_device_CreateRenderTarget(IDirect3DDevice8 *iface, UI
     TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, lockable %#x, surface %p.\n",
             iface, width, height, format, multisample_type, lockable, surface);
 
+    if (!format)
+        return D3DERR_INVALIDCALL;
+
     *surface = NULL;
     if (lockable)
         flags |= WINED3D_TEXTURE_CREATE_MAPPABLE;
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 9a9278b..2295300 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -8212,7 +8212,7 @@ static void test_format_unknown(void)
     hr = IDirect3DDevice8_CreateRenderTarget(device, 64, 64,
             D3DFMT_UNKNOWN, D3DMULTISAMPLE_NONE, FALSE, (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_CreateDepthStencilSurface(device, 64, 64,




More information about the wine-cvs mailing list