archrelease: copy trunk to community-any
[ArchLinux/community.git] / xcur2png / trunk / 0001-fix-wrong-math.patch
blob4e8ea45fd98d0c67d4aa2fa9bc2ece0e671187d4
1 From cda8f7af382f5c5f1e9a395eb03e2b819770d499 Mon Sep 17 00:00:00 2001
2 From: Yuji Saeki <44311901+YujiSaeki@users.noreply.github.com>
3 Date: Mon, 1 Jun 2020 22:32:16 +0200
4 Subject: [PATCH 1/1] fix wrong math
6 Signed-off-by: Christian Hesse <mail@eworm.de>
7 ---
8 xcur2png.c | 6 +++---
9 1 file changed, 3 insertions(+), 3 deletions(-)
11 diff --git a/xcur2png.c b/xcur2png.c
12 index 8723a10..f7dd95d 100644
13 --- a/xcur2png.c
14 +++ b/xcur2png.c
15 @@ -586,9 +586,9 @@ int writePngFileFromXcur (const XcursorDim width, const XcursorDim height,
16 unsigned int red = (pixels[i]>>16) & 0xff;
17 unsigned int green = (pixels[i]>>8) & 0xff;
18 unsigned int blue = pixels[i] & 0xff;
19 - red = (div (red * 256, alpha).quot) & 0xff;
20 - green = (div (green * 256, alpha).quot) & 0xff;
21 - blue = (div (blue * 256, alpha).quot) & 0xff;
22 + red = (div (red * 255, alpha).quot) & 0xff;
23 + green = (div (green * 255, alpha).quot) & 0xff;
24 + blue = (div (blue * 255, alpha).quot) & 0xff;
25 pix[i] = (alpha << 24) + (red << 16) + (green << 8) + blue;