Fix segfault on DISP_CHANGE_RESTART

Fixes #647.
This commit is contained in:
Camilla Berglund
2015-12-06 14:55:57 +01:00
parent b3d0bd6081
commit 5668b64839
2 changed files with 10 additions and 0 deletions
+8
View File
@@ -278,6 +278,14 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
result[*count - 1] = mode;
}
if (!*count)
{
// HACK: Report the current mode if no valid modes were found
result = calloc(1, sizeof(GLFWvidmode));
_glfwPlatformVideoMode(monitor, result);
*count = 1;
}
return result;
}