Nikolay Sivov : d3d11: Always initialize out shader pointer in CreateDomainShader().

Alexandre Julliard julliard at winehq.org
Fri May 27 16:35:30 CDT 2022


Module: wine
Branch: master
Commit: 72046ad7c4103490ab205e5f40b19adaae64c19a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=72046ad7c4103490ab205e5f40b19adaae64c19a

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri May 27 15:07:31 2022 +0300

d3d11: Always initialize out shader pointer in CreateDomainShader().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>

---

 dlls/d3d11/device.c      | 2 ++
 dlls/d3d11/tests/d3d11.c | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 286874af993..b73df94b50c 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3592,6 +3592,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDomainShader(ID3D11Device2 *
     TRACE("iface %p, byte_code %p, byte_code_length %Iu, class_linkage %p, shader %p.\n",
             iface, byte_code, byte_code_length, class_linkage, shader);
 
+    *shader = NULL;
+
     if (class_linkage)
         FIXME("Class linkage is not implemented yet.\n");
 
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 690f468e6cf..06cb2bc4273 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4824,6 +4824,7 @@ static void test_create_shader(const D3D_FEATURE_LEVEL feature_level)
     ID3D11Device *device, *tmp;
     ID3D11GeometryShader *gs;
     ID3D11VertexShader *vs;
+    ID3D11DomainShader *ds;
     ID3D11PixelShader *ps;
     ID3D11HullShader *hs;
     HRESULT hr;
@@ -5007,6 +5008,12 @@ static void test_create_shader(const D3D_FEATURE_LEVEL feature_level)
     ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
     ok(!hs, "Unexpected pointer %p.\n", hs);
 
+    /* Domain shader */
+    ds = (void *)0xdeadbeef;
+    hr = ID3D11Device_CreateDomainShader(device, gs_4_0, sizeof(gs_4_0), NULL, &ds);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
+    ok(!ds, "Unexpected pointer %p.\n", ds);
+
     refcount = ID3D11Device_Release(device);
     ok(!refcount, "Device has %lu references left.\n", refcount);
 }




More information about the wine-cvs mailing list