Piotr Caban : oleaut32: Update cdguid on data reallocation in WMSFT_compile_custdata.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jan 28 10:06:45 CST 2016


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Jan 27 13:04:19 2016 +0100

oleaut32: Update cdguid on data reallocation in WMSFT_compile_custdata.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/typelib.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 2a24b79..af477d5 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -9280,7 +9280,7 @@ static DWORD WMSFT_compile_custdata(struct list *custdata_list, WMSFT_TLBFile *f
 {
     WMSFT_SegContents *cdguids_seg = &file->cdguids_seg;
     DWORD ret = cdguids_seg->len, offs;
-    MSFT_CDGuid *cdguid = cdguids_seg->data;
+    MSFT_CDGuid *cdguid;
     TLBCustData *cd;
 
     if(list_empty(custdata_list))
@@ -9289,8 +9289,10 @@ static DWORD WMSFT_compile_custdata(struct list *custdata_list, WMSFT_TLBFile *f
     cdguids_seg->len += sizeof(MSFT_CDGuid) * list_count(custdata_list);
     if(!cdguids_seg->data){
         cdguid = cdguids_seg->data = heap_alloc(cdguids_seg->len);
-    }else
+    }else {
         cdguids_seg->data = heap_realloc(cdguids_seg->data, cdguids_seg->len);
+        cdguid = (MSFT_CDGuid*)((char*)cdguids_seg->data + ret);
+    }
 
     offs = ret + sizeof(MSFT_CDGuid);
     LIST_FOR_EACH_ENTRY(cd, custdata_list, TLBCustData, entry){




More information about the wine-cvs mailing list