diff options
author | Julian Smith <jules@op59.net> | 2020-01-08 11:58:14 +0000 |
---|---|---|
committer | Julian Smith <jules@op59.net> | 2020-01-08 11:58:14 +0000 |
commit | f71ebb708947e57eaf7cd33b319ec0676e03ba2e (patch) | |
tree | aba597edb45998bc72a9527edd97ca48e1ea9c24 /contrib/opvp | |
parent | 4bb071925d68398f8efb493c6b529e897a9bc356 (diff) | |
download | ghostpdl-f71ebb708947e57eaf7cd33b319ec0676e03ba2e.tar.gz |
Coverity 121442: avoid overflow when shifting.
Diffstat (limited to 'contrib/opvp')
-rw-r--r-- | contrib/opvp/gdevopvp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/opvp/gdevopvp.c b/contrib/opvp/gdevopvp.c index 115b3f265..2e09a596f 100644 --- a/contrib/opvp/gdevopvp.c +++ b/contrib/opvp/gdevopvp.c @@ -2561,7 +2561,11 @@ opvp_map_rgb_color(gx_device *dev, } else { k = 0; } - return (k + (y << 8) + (m << 16) + (c << 24)); + return (gx_color_index) k + + ((gx_color_index) y << 8) + + ((gx_color_index) m << 16) + + ((gx_color_index) c << 24) + ; break; case OPVP_CSPACE_DEVICEGRAY: #if GS_VERSION_MAJOR >= 8 |