From f5515075f243e51f737a4e37f0141239f35413e7 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 1 Oct 2019 21:55:57 +0200 Subject: [PATCH] [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. --- src/dxgi/dxgi_output.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dxgi/dxgi_output.cpp b/src/dxgi/dxgi_output.cpp index 4607db195..65a6a840f 100644 --- a/src/dxgi/dxgi_output.cpp +++ b/src/dxgi/dxgi_output.cpp @@ -219,7 +219,7 @@ namespace dxvk { std::vector modes; if (pDesc) - modes.resize(*pNumModes); + modes.resize(std::max(1u, *pNumModes)); HRESULT hr = GetDisplayModeList1( EnumFormat, Flags, pNumModes,