Paul Gofman : d3dx9: Don't add const setting entries with zero count.

Alexandre Julliard julliard at winehq.org
Thu Jun 1 18:49:36 CDT 2017


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

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Wed May 31 23:35:52 2017 +0200

d3dx9: Don't add const setting entries with zero count.

Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dx9_36/preshader.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/d3dx9_36/preshader.c b/dlls/d3dx9_36/preshader.c
index 5974329..7afbc03 100644
--- a/dlls/d3dx9_36/preshader.c
+++ b/dlls/d3dx9_36/preshader.c
@@ -1226,6 +1226,11 @@ static HRESULT init_set_constants_param(struct d3dx_const_tab *const_tab, ID3DXC
     const_set.register_count = desc.RegisterCount;
     table_type = table_info[const_set.table].type;
     get_const_upload_info(&const_set, &info);
+    if (!info.count)
+    {
+        TRACE("%s has zero count, skipping.\n", debugstr_a(param->name));
+        return D3D_OK;
+    }
 
     if (table_type_from_param_type(param->type) == PRES_VT_COUNT)
         return D3DERR_INVALIDCALL;




More information about the wine-cvs mailing list