diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-07-13 10:17:11 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-07-14 09:31:32 +0100 |
commit | b10629a5192005c39701502870a66ef4247234a9 (patch) | |
tree | b0b80422449e86012e12eb7341a2dd37fccbe4a1 /devices/gdevstc.c | |
parent | 68809cefdbce78c7140ebfed4e9eb208fef74cf3 (diff) | |
download | ghostpdl-b10629a5192005c39701502870a66ef4247234a9.tar.gz |
Coverity 371690: Avoid unsigned compare with zero.
Diffstat (limited to 'devices/gdevstc.c')
-rw-r--r-- | devices/gdevstc.c | 6 |
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; |