From 85993759b53998110e2c6fe47057c75c35ef19cc Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Wed, 19 Apr 2017 13:12:06 +0200 Subject: [PATCH] Fix potential infinite loop in float_distance(). --- glm/gtc/ulp.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/gtc/ulp.inl b/glm/gtc/ulp.inl index c5fb0cad..e3a0df5c 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -287,7 +287,7 @@ namespace glm if(x < y) { T temp = x; - while(temp != y)// && ulp < std::numeric_limits::max()) + while(temp < y)// && ulp < std::numeric_limits::max()) { ++ulp; temp = next_float(temp); @@ -296,7 +296,7 @@ namespace glm else if(y < x) { T temp = y; - while(temp != x)// && ulp < std::numeric_limits::max()) + while(temp < x)// && ulp < std::numeric_limits::max()) { ++ulp; temp = next_float(temp);