2
0
Эх сурвалжийг харах

Fix `set_window_size` crash when using NaN

Fixes #60466.
Paweł Fertyk 3 жил өмнө
parent
commit
b3f822eaae

+ 2 - 0
platform/x11/os_x11.cpp

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