mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
Add basic argument checks for glfwSetWindowMonitor
This commit is contained in:
16
src/window.c
16
src/window.c
@@ -737,6 +737,22 @@ GLFWAPI void glfwSetWindowMonitor(GLFWwindow* wh,
|
||||
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
{
|
||||
_glfwInputError(GLFW_INVALID_VALUE,
|
||||
"Invalid window size %ix%i",
|
||||
width, height);
|
||||
return;
|
||||
}
|
||||
|
||||
if (refreshRate < 0 && refreshRate != GLFW_DONT_CARE)
|
||||
{
|
||||
_glfwInputError(GLFW_INVALID_VALUE,
|
||||
"Invalid refresh rate %i",
|
||||
refreshRate);
|
||||
return;
|
||||
}
|
||||
|
||||
window->videoMode.width = width;
|
||||
window->videoMode.height = height;
|
||||
window->videoMode.refreshRate = refreshRate;
|
||||
|
||||
Reference in New Issue
Block a user