[PATCH 3/5] wined3d: Properly allocate heap memory for volumes

Stefan Dösinger stefan at codeweavers.com
Mon Aug 19 03:52:33 CDT 2013


---
 dlls/wined3d/volume.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index b4a8c64..f5f1cf3 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -184,7 +184,16 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
             volume, map_desc, box, flags);
 
     if (!volume->resource.allocatedMemory)
-        volume->resource.allocatedMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, volume->resource.size);
+    {
+        volume->resource.heap_mem = wined3d_alloc_resource_mem(volume->resource.size);
+        if (!volume->resource.heap_mem)
+        {
+            WARN("Out of memory.\n");
+            map_desc->data = NULL;
+            return E_OUTOFMEMORY;
+        }
+        volume->resource.allocatedMemory = volume->resource.heap_mem->ptr;
+    }
 
     TRACE("allocatedMemory %p.\n", volume->resource.allocatedMemory);
 
-- 
1.8.1.5




More information about the wine-patches mailing list