From 1eac29d168cec63b99009b122a3dbdc558d38852 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 14 May 2013 01:06:31 +0200 Subject: [PATCH] Ensured that count out parameter is always set. --- src/monitor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/monitor.c b/src/monitor.c index f11f5c15..00c289a0 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -250,7 +250,10 @@ void _glfwSplitBPP(int bpp, int* red, int* green, int* blue) GLFWAPI GLFWmonitor** glfwGetMonitors(int* count) { + *count = 0; + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); + *count = _glfw.monitorCount; return (GLFWmonitor**) _glfw.monitors; } @@ -301,6 +304,8 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count) { _GLFWmonitor* monitor = (_GLFWmonitor*) handle; + *count = 0; + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); if (!refreshVideoModes(monitor))