From 85eb6e4876c1bb6fea32833e3e02a1b1583209aa Mon Sep 17 00:00:00 2001 From: Satej Mhatre Date: Thu, 17 Sep 2020 19:47:00 -0500 Subject: [PATCH] Adding checks to avoid desktop environment freeze for waitForVisibilityNotify --- src/window.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/window.c b/src/window.c index efcb4125e..f00f483ce 100644 --- a/src/window.c +++ b/src/window.c @@ -162,10 +162,12 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, assert(title != NULL); assert(width >= 0); assert(height >= 0); + assert(width <= 32767); + assert(height <= 32767); _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - if (width <= 0 || height <= 0) + if (width <= 0 || height <= 0 || width > 32767 || height > 32767) { _glfwInputError(GLFW_INVALID_VALUE, "Invalid window size %ix%i", @@ -941,10 +943,12 @@ GLFWAPI void glfwSetWindowMonitor(GLFWwindow* wh, assert(window != NULL); assert(width >= 0); assert(height >= 0); + assert(width <= 32767); + assert(height <= 32767); _GLFW_REQUIRE_INIT(); - if (width <= 0 || height <= 0) + if (width <= 0 || height <= 0 || width > 32767 || height > 32767) { _glfwInputError(GLFW_INVALID_VALUE, "Invalid window size %ix%i",