SafeArrayRedim: Use the correct size for resize too.
This commit is contained in:
parent
d6771b1333
commit
ff16b32499
|
@ -1457,7 +1457,7 @@ HRESULT WINAPI SafeArrayRedim(SAFEARRAY *psa, SAFEARRAYBOUND *psabound)
|
||||||
ULONG ulOldSize, ulNewSize;
|
ULONG ulOldSize, ulNewSize;
|
||||||
PVOID pvNewData;
|
PVOID pvNewData;
|
||||||
|
|
||||||
ulOldSize = SAFEARRAY_GetCellCount(psa);
|
ulOldSize = SAFEARRAY_GetCellCount(psa) * psa->cbElements;
|
||||||
if (ulOldSize)
|
if (ulOldSize)
|
||||||
ulNewSize = (ulOldSize / oldBounds->cElements) * psabound->cElements;
|
ulNewSize = (ulOldSize / oldBounds->cElements) * psabound->cElements;
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue