Browse Source

Fix `set_window_size` crash when using NaN

Fixes #60466.

(cherry picked from commit b3f822eaae322fee17716aff3bce8dbecbb12981)
Paweł Fertyk 3 years ago
parent
commit
d8f8ae0ce1
1 changed files with 2 additions and 0 deletions
  1. 2 0
      platform/x11/os_x11.cpp

+ 2 - 0
platform/x11/os_x11.cpp

@@ -1416,6 +1416,8 @@ void OS_X11::set_window_size(const Size2 p_size) {
 	int old_h = xwa.height;
 
 	Size2 size = p_size;
+
+	ERR_FAIL_COND(Math::is_nan(size.x) || Math::is_nan(size.y));
 	size.x = MAX(1, size.x);
 	size.y = MAX(1, size.y);