Skip to content

Commit

Permalink
Fix WebView2 accessibility crash in ProviderWrapper::GetRuntimeId (#7345
Browse files Browse the repository at this point in the history
)

* Fix lLBounds arg to SafeArrayCreateVector

* add OOM check

Co-authored-by: Dmitriy Komin <[email protected]>
  • Loading branch information
DmitriyKomin and Dmitriy Komin authored Jul 11, 2022
1 parent b0a4412 commit eb0f8ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dev/WebView2/WebView2AutomationPeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ struct ProviderWrapper : winrt::implements<ProviderWrapper, winrt::IInspectable,
{
*pRetVal = nullptr;

SAFEARRAY* psa = SafeArrayCreateVector(VT_I4, 1, 2);
SAFEARRAY* psa = SafeArrayCreateVector(VT_I4, 0, 2);
if (psa == nullptr)
{
return E_OUTOFMEMORY;
}

auto id = winrt::AutomationPeer::GenerateRawElementProviderRuntimeId();

Expand Down

0 comments on commit eb0f8ef

Please sign in to comment.