From debb76f62ab13fa8d3047cf6b7fad2636a20fc13 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 13 Dec 2022 16:09:32 -0800 Subject: [PATCH] validate scissor dimensions --- src/Graphics/CommandBuffer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index 90a3a6b..c32139b 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -823,6 +823,11 @@ namespace MoonWorks.Graphics { #if DEBUG AssertRenderPassActive(); + + if (scissor.X < 0 || scissor.Y < 0 || scissor.W <= 0 || scissor.H <= 0) + { + throw new System.ArgumentOutOfRangeException("Scissor position cannot be negative and dimensions must be positive!"); + } #endif Refresh.Refresh_SetScissor(