From 2ed1778df9ea5d81fff22f76f125b08995454847 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 2 Nov 2023 17:49:38 +0100 Subject: [PATCH] [d3d11] Handle potential integer overflow when validating draw offsets Apparently some games use -1 as an argument offset, which is nonsensical and leads to issues. --- src/d3d11/d3d11_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_context.h b/src/d3d11/d3d11_context.h index 618c07d69..7383507f0 100644 --- a/src/d3d11/d3d11_context.h +++ b/src/d3d11/d3d11_context.h @@ -1130,7 +1130,7 @@ namespace dxvk { if (likely(pBuffer != nullptr)) bufferSize = static_cast(pBuffer)->Desc()->ByteWidth; - return bufferSize >= Offset + Size; + return uint64_t(bufferSize) >= uint64_t(Offset) + uint64_t(Size); } private: