Author: mlytwyn
Date: Thu May 12 21:41:29 2016
New Revision: 39747

URL: http://svn.gna.org/viewcvs/gnustep?rev=39747&view=rev
Log:
Double check for 0 before divide

Modified:
    libs/back/branches/gnustep_testplant_branch/Source/gsc/gscolors.c

Modified: libs/back/branches/gnustep_testplant_branch/Source/gsc/gscolors.c
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/back/branches/gnustep_testplant_branch/Source/gsc/gscolors.c?rev=39747&r1=39746&r2=39747&view=diff
==============================================================================
--- libs/back/branches/gnustep_testplant_branch/Source/gsc/gscolors.c   
(original)
+++ libs/back/branches/gnustep_testplant_branch/Source/gsc/gscolors.c   Thu May 
12 21:41:29 2016
@@ -282,7 +282,17 @@
            diff = V - Temp;
            if (V == r)
              {
-               H = (g - b)/diff;
+          if (diff == 0.0)
+            {
+              // Invoke same code as r=g=b above...
+              H = 0;
+              // diff == 0 so diff/V == 0
+              // V already == r
+            }
+          else
+            {
+              H = (g - b)/diff;
+            }
              }
            else if (V == g)
              {


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to