From: Cristy Date: Sat, 3 Feb 2018 01:15:30 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5898 X-Git-Tag: 7.0.7-23~182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf3b31079b7b857cf64ea0544baeb4eb2992c737;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5898 --- diff --git a/coders/sixel.c b/coders/sixel.c index 39e027199..806f27a36 100644 --- a/coders/sixel.c +++ b/coders/sixel.c @@ -179,9 +179,9 @@ static int hls_to_rgb(int hue, int lum, int sat) R = G = B = (lum * RGBMAX) / HLSMAX; } else { if (lum <= (HLSMAX / 2)) { - Magic2 = (lum * (HLSMAX + sat) + (HLSMAX / 2)) / HLSMAX; + Magic2 = (int) (((ssize_t) lum * (HLSMAX + sat) + (HLSMAX / 2)) / HLSMAX); } else { - Magic2 = lum + sat - ((lum * sat) + (HLSMAX / 2)) / HLSMAX; + Magic2 = (int) (lum + sat - (((ssize_t) lum * sat) + (HLSMAX / 2)) / HLSMAX); } Magic1 = 2 * lum - Magic2;