From 4da741daf16f041f0222f4fb71ef648d759251df Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 24 Feb 2014 08:15:59 +0400 Subject: [PATCH] oleaut32: Fix buffer increment step for VT_RECORD case doing SafeArrayCopyData(). --- dlls/oleaut32/safearray.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/oleaut32/safearray.c b/dlls/oleaut32/safearray.c index f66cc802cf8..4801f3b88e1 100644 --- a/dlls/oleaut32/safearray.c +++ b/dlls/oleaut32/safearray.c @@ -401,7 +401,6 @@ static HRESULT SAFEARRAY_CopyData(SAFEARRAY *psa, SAFEARRAY *dest) } else if (psa->fFeatures & FADF_RECORD) { - const SAFEARRAYBOUND* psab = psa->rgsabound; BYTE *dest_data = dest->pvData; BYTE *src_data = psa->pvData; IRecordInfo *record; @@ -412,11 +411,14 @@ static HRESULT SAFEARRAY_CopyData(SAFEARRAY *psa, SAFEARRAY *dest) /* RecordCopy() clears destination record */ hr = IRecordInfo_RecordCopy(record, src_data, dest_data); if (FAILED(hr)) break; - src_data += psab->cElements; - dest_data += psab->cElements; + src_data += psa->cbElements; + dest_data += psa->cbElements; } SafeArraySetRecordInfo(dest, record); + /* This value is set to 32 bytes by default on descriptor creation, + update with actual structure size. */ + dest->cbElements = psa->cbElements; IRecordInfo_Release(record); } else if (psa->fFeatures & (FADF_UNKNOWN|FADF_DISPATCH))