[PATCH 6/6] d3d8: Do not modify the "texture" pointer for D3DFMT_UNKNOWN in d3d8_device_CreateVolumeTexture().

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


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 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 ad5880c..2c8d6cb 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -824,6 +824,9 @@ static HRESULT WINAPI d3d8_device_CreateVolumeTexture(IDirect3DDevice8 *iface,
     TRACE("iface %p, width %u, height %u, depth %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
             iface, width, height, depth, levels, usage, format, pool, texture);
 
+    if (!format)
+        return D3DERR_INVALIDCALL;
+
     *texture = NULL;
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index ff3c9b4..9a9278b 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -8242,7 +8242,7 @@ static void test_format_unknown(void)
     hr = IDirect3DDevice8_CreateVolumeTexture(device, 64, 64, 1, 1, 0,
             D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, (IDirect3DVolumeTexture8 **)&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);
 
     refcount = IDirect3DDevice8_Release(device);
     ok(!refcount, "Device has %u references left.\n", refcount);
-- 
2.1.4




More information about the wine-patches mailing list