[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).
This commit is contained in:
John Bowler 2015-03-22 19:42:14 -05:00 committed by Glenn Randers-Pehrson
parent b383798ac9
commit 6eecfe3886
3 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.17rc06 - March 21, 2015
Libpng 1.6.17rc06 - March 23, 2015
This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version.
@ -92,8 +92,14 @@ Version 1.6.17rc05 [March 21, 2015]
Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes
the Coverity scan without them.
Version 1.6.17rc06 [March 21, 2015]
Version 1.6.17rc06 [March 23, 2015]
Remove pnglibconf.dfn and pnglibconf.pre with "make clean".
Reformatted some "&0xff" instances to "& 0xff".
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).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -5193,8 +5193,14 @@ Version 1.6.17rc05 [March 21, 2015]
Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes
the Coverity scan without them.
Version 1.6.17rc06 [March 21, 2015]
Version 1.6.17rc06 [March 23, 2015]
Remove pnglibconf.dfn and pnglibconf.pre with "make clean".
Reformatted some "&0xff" instances to "& 0xff".
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).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -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;
}