Commit fbdfef73 authored by Ove Kaaven's avatar Ove Kaaven Committed by Alexandre Julliard

If SafeArrayGetElement is called on a variant array, initialize

destination variant before copying the array element to it, some badly behaved apps don't seem to do it themselves.
parent a0da6694
......@@ -356,7 +356,9 @@ HRESULT WINAPI SafeArrayGetElement(
*((BSTR*)pv) = pbstrReturnedStr;
}
else if( psa->fFeatures == FADF_VARIANT) {
HRESULT hr = VariantCopy(pv, elementStorageAddress);
HRESULT hr;
VariantInit(pv);
hr = VariantCopy(pv, elementStorageAddress);
if (FAILED(hr)) {
SafeArrayUnlock(psa);
return hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment