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

Alexandre Julliard julliard at winehq.org
Thu Feb 9 15:54:25 CST 2017


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Feb  9 12:52:39 2017 +0100

d3d8: Do not modify the "texture" pointer for D3DFMT_UNKNOWN in d3d8_device_CreateCubeTexture().

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 989c1b0..ad5880c 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -853,6 +853,9 @@ static HRESULT WINAPI d3d8_device_CreateCubeTexture(IDirect3DDevice8 *iface, UIN
     TRACE("iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
             iface, edge_length, 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 c05c9f2..ff3c9b4 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -8236,7 +8236,7 @@ static void test_format_unknown(void)
     hr = IDirect3DDevice8_CreateCubeTexture(device, 64, 1, 0,
             D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, (IDirect3DCubeTexture8 **)&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_CreateVolumeTexture(device, 64, 64, 1, 1, 0,




More information about the wine-cvs mailing list