1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[dxgi] Fix GetDisplayModeList behaviour with a zero mode count

Allocate at least one array element so that we don't accidentally
treat the mode list like it was NULL. Fixes a wine test failure.
This commit is contained in:
Philip Rebohle 2019-10-01 21:55:57 +02:00
parent 2f4e4abcac
commit f5515075f2
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -219,7 +219,7 @@ namespace dxvk {
std::vector<DXGI_MODE_DESC1> modes;
if (pDesc)
modes.resize(*pNumModes);
modes.resize(std::max(1u, *pNumModes));
HRESULT hr = GetDisplayModeList1(
EnumFormat, Flags, pNumModes,