Sebastian Lackner : wined3d: Ensure that wined3d_cs_st_require_space allocates the required space.

Alexandre Julliard julliard at winehq.org
Wed Oct 2 15:49:13 CDT 2013


Module: wine
Branch: master
Commit: af759e30c901ac72cc9c889d7637fac8395295b1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=af759e30c901ac72cc9c889d7637fac8395295b1

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Tue Oct  1 19:58:54 2013 +0200

wined3d: Ensure that wined3d_cs_st_require_space allocates the required space.

---

 dlls/wined3d/cs.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index cdb49ce..6919e91 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -374,10 +374,11 @@ static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
     {
         void *new_data;
 
-        if (!(new_data = HeapReAlloc(GetProcessHeap(), 0, cs->data, cs->data_size * 2)))
+        size = max( size, cs->data_size * 2 );
+        if (!(new_data = HeapReAlloc(GetProcessHeap(), 0, cs->data, size)))
             return NULL;
 
-        cs->data_size *= 2;
+        cs->data_size = size;
         cs->data = new_data;
     }
 




More information about the wine-cvs mailing list