summaryrefslogtreecommitdiff
path: root/devices/gdevstc.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-07-13 10:17:11 +0100
committerRobin Watts <Robin.Watts@artifex.com>2021-07-14 09:31:32 +0100
commitb10629a5192005c39701502870a66ef4247234a9 (patch)
treeb0b80422449e86012e12eb7341a2dd37fccbe4a1 /devices/gdevstc.c
parent68809cefdbce78c7140ebfed4e9eb208fef74cf3 (diff)
downloadghostpdl-b10629a5192005c39701502870a66ef4247234a9.tar.gz
Coverity 371690: Avoid unsigned compare with zero.
Diffstat (limited to 'devices/gdevstc.c')
-rw-r--r--devices/gdevstc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/devices/gdevstc.c b/devices/gdevstc.c
index 69977e96e..b4e8c9f4b 100644
--- a/devices/gdevstc.c
+++ b/devices/gdevstc.c
@@ -2307,9 +2307,9 @@ stc_cmyk_map_color_rgb(gx_device *pdev, gx_color_index color, gx_color_value cv[
c = stc_expand(sd,0, color & l);
k = gx_max_color_value - k;
- c = k - c; if (c < 0) c = 0;
- m = k - m; if (m < 0) c = 0;
- y = k - c; if (y < 0) c = 0;
+ c = (k < c) ? 0 : k - c;
+ m = (k < m) ? 0 : k - m;
+ y = (k < c) ? 0 : k - c;
cv[0] = c;
cv[1] = m;