[PATCH 1/8] d3dx9: Limit constant size by register count instead of table size.

Paul Gofman gofmanp at gmail.com
Fri Jun 2 04:58:05 CDT 2017


Signed-off-by: Paul Gofman <gofmanp at gmail.com>
---
 dlls/d3dx9_36/preshader.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/d3dx9_36/preshader.c b/dlls/d3dx9_36/preshader.c
index aaf3961..cc103f5 100644
--- a/dlls/d3dx9_36/preshader.c
+++ b/dlls/d3dx9_36/preshader.c
@@ -1070,14 +1070,15 @@ static void set_constants(struct d3dx_regstore *rs, struct d3dx_const_tab *const
                     unsigned int *in;
                     unsigned int offset;
 
-                    offset = start_offset + i * info.major_stride + j;
-                    if (get_reg_offset(table, offset) >= rs->table_sizes[table])
+                    offset = i * info.major_stride + j;
+                    if (get_reg_offset(table, offset) >= const_set->register_count)
                     {
                         if (table != PRES_REGTAB_OBCONST)
-                            FIXME("Output offset exceeds table size, name %s, component %u.\n",
+                            FIXME("Output offset exceeds regiser count, name %s, component %u.\n",
                                     debugstr_a(param->name), i);
                         break;
                     }
+                    offset += start_offset;
                     if (info.transpose)
                         param_offset = i + j * info.major;
                     else
-- 
2.9.4




More information about the wine-patches mailing list