aboutsummaryrefslogtreecommitdiff
path: root/src/play-button.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/play-button.c')
-rw-r--r--src/play-button.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/play-button.c b/src/play-button.c
index 31cdf5a..2ab5fc8 100644
--- a/src/play-button.c
+++ b/src/play-button.c
@@ -796,7 +796,10 @@ _color_rgb_to_hls (gdouble *r,
else
s = (max-min)/(2-max-min);
- delta = max -min;
+ delta = (max -min) != 0 ? (max -min) : 1;
+
+ if(delta == 0)
+ delta = 1;
if (red == max)
h = (green-blue)/delta;
else if (green == max)