dxgi: Check NULL output parameter in dxgi_adapter_EnumOutputs().

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2020-02-20 20:48:18 +08:00 committed by Alexandre Julliard
parent 23a8887ded
commit ba4ee49705
2 changed files with 6 additions and 0 deletions

View File

@ -128,6 +128,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac
TRACE("iface %p, output_idx %u, output %p.\n", iface, output_idx, output);
if (!output)
return E_INVALIDARG;
if (output_idx > 0)
{
*output = NULL;

View File

@ -1175,6 +1175,9 @@ static void test_output(void)
hr = IDXGIDevice_GetAdapter(device, &adapter);
ok(SUCCEEDED(hr), "GetAdapter failed, hr %#x.\n", hr);
hr = IDXGIAdapter_EnumOutputs(adapter, 0, NULL);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = IDXGIAdapter_EnumOutputs(adapter, 0, &output);
if (hr == DXGI_ERROR_NOT_FOUND)
{