From 053e5b59ec5d546b5fa2fd315caccadb98eb8cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Sat, 25 Aug 2012 16:28:34 +0200 Subject: [PATCH] d3dx9: Fix RegisterCount calculation. --- dlls/d3dx9_36/shader.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index e30292fc395..162909b2708 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -1616,8 +1616,6 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru if (count) { - WORD size_element = 0; - constant->constants = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*constant->constants) * count); if (!constant->constants) { @@ -1634,8 +1632,7 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru if (hr != D3D_OK) goto error; - if (i == 0) size_element = constant->constants[i].desc.RegisterCount; - size += size_element; + size += constant->constants[i].desc.RegisterCount; } } else