[PATCH 4/5] wined3d: Do not call wined3d_buffer_map() before "buffer->maps" is initialized.
Józef Kucia
jkucia at codeweavers.com
Fri May 27 04:03:54 CDT 2016
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/wined3d/buffer.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index c82bfdb..62a1921 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1331,17 +1331,6 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
buffer->flags |= WINED3D_BUFFER_CREATEBO;
}
- if (data)
- {
- if (FAILED(hr = wined3d_buffer_upload_data(buffer, NULL, data->data)))
- {
- ERR("Failed to upload data, hr %#x.\n", hr);
- buffer_unload(&buffer->resource);
- resource_cleanup(&buffer->resource);
- return hr;
- }
- }
-
if (!(buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps))))
{
ERR("Out of memory.\n");
@@ -1351,6 +1340,15 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
}
buffer->maps_size = 1;
+ if (data && FAILED(hr = wined3d_buffer_upload_data(buffer, NULL, data->data)))
+ {
+ ERR("Failed to upload data, hr %#x.\n", hr);
+ buffer_unload(&buffer->resource);
+ resource_cleanup(&buffer->resource);
+ HeapFree(GetProcessHeap(), 0, buffer->maps);
+ return hr;
+ }
+
return WINED3D_OK;
}
--
2.7.3
More information about the wine-patches
mailing list