[PATCH 12/12] wined3d: Make sure that "tgsm_count" is not decreased while adding TGSM declarations.

Józef Kucia jkucia at codeweavers.com
Tue Mar 7 02:50:23 CST 2017


Suggested by Sebastian Lackner.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index f867766..7186fdf 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -884,7 +884,7 @@ static HRESULT shader_reg_maps_add_tgsm(struct wined3d_shader_reg_maps *reg_maps
             register_idx + 1, sizeof(*reg_maps->tgsm)))
         return E_OUTOFMEMORY;
 
-    reg_maps->tgsm_count = register_idx + 1;
+    reg_maps->tgsm_count = max(register_idx + 1, reg_maps->tgsm_count);
     tgsm = &reg_maps->tgsm[register_idx];
     tgsm->size = size;
     tgsm->stride = stride;
-- 
2.10.2




More information about the wine-patches mailing list