summaryrefslogtreecommitdiff
path: root/pngread.c
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2015-03-22 19:42:14 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2015-03-22 19:42:14 -0500
commit6eecfe38864a3596fe8fbbe400c6cb6111117d18 (patch)
tree7df16019878dbd352563e85b4d124a9c311a2307 /pngread.c
parentb383798ac9d7d320849293563e4670527750b857 (diff)
downloadlibpng-6eecfe38864a3596fe8fbbe400c6cb6111117d18.tar.gz
[libpng16] Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha
value was wrong. It's not clear if this affected the final stored value; in the obvious code path the upper and lower 8-bits of the alpha value were identical and the alpha was truncated to 8-bits rather than dividing by 257 (John Bowler).
Diffstat (limited to 'pngread.c')
-rw-r--r--pngread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pngread.c b/pngread.c
index c658a4692..ab01cae13 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1823,6 +1823,7 @@ png_create_colormap_entry(png_image_read_control *display,
y = (y + 128) >> 8;
y *= 255;
y = PNG_sRGB_FROM_LINEAR((y + 64) >> 7);
+ alpha = PNG_DIV257(alpha);
encoding = P_sRGB;
}