summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-03-06 16:46:23 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-03-06 16:46:23 (GMT)
commit8701bf597e98498ab4d757caa5a2bb9dd46a0554 (patch)
treefca62059854b4d932fd151bb44ef26b6144fc513
parente4f2cea837155dd305272c2a5170da8b3cb1b0c9 (diff)
downloadtk-8701bf597e98498ab4d757caa5a2bb9dd46a0554.zip
tk-8701bf597e98498ab4d757caa5a2bb9dd46a0554.tar.gz
tk-8701bf597e98498ab4d757caa5a2bb9dd46a0554.tar.bz2
[6b3644a485] Fix -alpha applied to 16-bit color PNG. Thanks TheLemonMan.
-rw-r--r--generic/tkImgPNG.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index c6e3029..6e64afa 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -2245,10 +2245,10 @@ ApplyAlpha(
p += offset;
if (16 == pngPtr->bitDepth) {
- register int channel;
+ register unsigned int channel;
while (p < endPtr) {
- channel = (unsigned char)
+ channel = (unsigned int)
(((p[0] << 8) | p[1]) * pngPtr->alpha);
*p++ = (unsigned char) (channel >> 8);