d3dcompiler: Fix initial allocation (Valgrind).
Matteo Bruni
matteo.mystral at gmail.com
Fri Feb 18 12:54:07 CST 2011
-------------- next part --------------
From a42e9468242b1df2280f3d3126b758de7e6b2642 Mon Sep 17 00:00:00 2001
From: Matteo Bruni <mbruni at codeweavers.com>
Date: Mon, 7 Feb 2011 14:35:37 +0100
Subject: d3dcompiler: Fix initial allocation (Valgrind).
---
dlls/d3dcompiler_43/compiler.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c
index 42ad09b..8527870 100644
--- a/dlls/d3dcompiler_43/compiler.c
+++ b/dlls/d3dcompiler_43/compiler.c
@@ -206,13 +206,13 @@ static void *wpp_open_mem(const char *filename, int type)
{
if(includes_capacity == 0)
{
- includes = HeapAlloc(GetProcessHeap(), 0, INCLUDES_INITIAL_CAPACITY);
+ includes = HeapAlloc(GetProcessHeap(), 0, INCLUDES_INITIAL_CAPACITY * sizeof(*includes));
if(includes == NULL)
{
ERR("Error allocating memory for the loaded includes structure\n");
goto error;
}
- includes_capacity = INCLUDES_INITIAL_CAPACITY;
+ includes_capacity = INCLUDES_INITIAL_CAPACITY * sizeof(*includes);
}
else
{
--
1.7.3.4
More information about the wine-patches
mailing list