From 62f812873ca54f30ea892032039b2f635993a574 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 6 Sep 2011 15:47:17 +0200 Subject: [PATCH] Added gamma value error check. --- src/gamma.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gamma.c b/src/gamma.c index 787098a0..a82581dd 100644 --- a/src/gamma.c +++ b/src/gamma.c @@ -52,6 +52,13 @@ GLFWAPI void glfwSetGamma(float gamma) return; } + if (gamma <= 0.f) + { + _glfwSetError(GLFW_INVALID_VALUE, + "glfwSetGamma: Gamma value must be greater than zero"); + return; + } + for (i = 0; i < size; i++) { float value = (float) i / ((float) (size - 1));