From a950872c7c8d2c0e81c03ae822d634ea0908dffc Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 24 Sep 2018 16:22:12 +0200 Subject: [PATCH] [dxvk] Check whether the vertex binding / attribute count is valid --- src/dxvk/dxvk_graphics.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dxvk/dxvk_graphics.cpp b/src/dxvk/dxvk_graphics.cpp index aef0738d..41bdc90e 100644 --- a/src/dxvk/dxvk_graphics.cpp +++ b/src/dxvk/dxvk_graphics.cpp @@ -397,6 +397,11 @@ namespace dxvk { if ((state.iaPatchVertexCount != 0) && (m_tcs == nullptr || m_tes == nullptr)) return false; + // Prevent unintended out-of-bounds access to the IL arrays + if (state.ilAttributeCount > DxvkLimits::MaxNumVertexAttributes + || state.ilBindingCount > DxvkLimits::MaxNumVertexBindings) + return false; + // No errors return true; }