Fixed glfwSetTime accepting invalid values.

Fixes #436.
This commit is contained in:
Camilla Berglund
2015-02-19 23:49:46 +01:00
parent 11c22d6a17
commit 85de0db05d
3 changed files with 10 additions and 1 deletions
+8
View File
@@ -28,6 +28,7 @@
#include "internal.h"
#include <stdlib.h>
#include <float.h>
#if defined(_MSC_VER)
#include <malloc.h>
#endif
@@ -591,6 +592,13 @@ GLFWAPI double glfwGetTime(void)
GLFWAPI void glfwSetTime(double time)
{
_GLFW_REQUIRE_INIT();
if (time != time || time - DBL_MAX == time || time < 0.0)
{
_glfwInputError(GLFW_INVALID_VALUE, "Invalid time");
return;
}
_glfwPlatformSetTime(time);
}