[babl] HSL: make hue be set in all switch cases for rgb_to_hsl



commit cc909c4d7baf49591887e0b5e18f40ad437543e8
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Oct 3 15:53:23 2017 +0200

    HSL: make hue be set in all switch cases for rgb_to_hsl

 extensions/HSL.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/extensions/HSL.c b/extensions/HSL.c
index 96dbd60..88f8705 100644
--- a/extensions/HSL.c
+++ b/extensions/HSL.c
@@ -145,7 +145,8 @@ rgb_to_hsl_step (double* src,
         case 0: hue = (green - blue)  / diff + (green < blue ? 6.0 : 0.0); break;
         case 1: hue = (blue  - red)   / diff + 2.0; break;
         case 2: hue = (red   - green) / diff + 4.0; break;
-        default: break;
+        default: hue = 0.0;
+          break;
         }
       hue /= 6.0;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]