[libpng16] Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that

were accidentally removed from libpng-1.6.17.
This commit is contained in:
Glenn Randers-Pehrson 2016-02-13 12:01:35 -06:00
parent 08bd7654bc
commit baf301d122
3 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.22beta03 - February 10, 2016 Libpng 1.6.22beta03 - February 13, 2016
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@ -54,9 +54,11 @@ Version 1.6.22beta02 [February 8, 2016]
extend the png_set_alpha_mode range as HDR imaging systems are starting extend the png_set_alpha_mode range as HDR imaging systems are starting
to emerge. to emerge.
Version 1.6.22beta03 [February 10, 2016] Version 1.6.22beta03 [February 13, 2016]
Added a common-law trademark notice and export control information Added a common-law trademark notice and export control information
to the LICENSE file, png.h, and the man page. to the LICENSE file, png.h, and the man page.
Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that
were accidentally removed from libpng-1.6.17.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -5513,9 +5513,11 @@ Version 1.6.22beta02 [February 8, 2016]
extend the png_set_alpha_mode range as HDR imaging systems are starting extend the png_set_alpha_mode range as HDR imaging systems are starting
to emerge. to emerge.
Version 1.6.22beta03 [February 10, 2016] Version 1.6.22beta03 [February 13, 2016]
Added a common-law trademark notice and export control information Added a common-law trademark notice and export control information
to the LICENSE file, png.h, and the man page. to the LICENSE file, png.h, and the man page.
Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that
were accidentally removed from libpng-1.6.17.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -23,10 +23,10 @@
void PNGAPI void PNGAPI
png_save_uint_32(png_bytep buf, png_uint_32 i) png_save_uint_32(png_bytep buf, png_uint_32 i)
{ {
buf[0] = (png_byte)(i >> 24); buf[0] = (png_byte)((i >> 24) & 0xffU);
buf[1] = (png_byte)(i >> 16); buf[1] = (png_byte)((i >> 16) & 0xffU);
buf[2] = (png_byte)(i >> 8); buf[2] = (png_byte)((i >> 8) & 0xffU);
buf[3] = (png_byte)(i ); buf[3] = (png_byte)( i & 0xffU);
} }
/* Place a 16-bit number into a buffer in PNG byte order. /* Place a 16-bit number into a buffer in PNG byte order.
@ -36,8 +36,8 @@ png_save_uint_32(png_bytep buf, png_uint_32 i)
void PNGAPI void PNGAPI
png_save_uint_16(png_bytep buf, unsigned int i) png_save_uint_16(png_bytep buf, unsigned int i)
{ {
buf[0] = (png_byte)(i >> 8); buf[0] = (png_byte)((i >> 8) & 0xffU);
buf[1] = (png_byte)(i ); buf[1] = (png_byte)( i & 0xffU);
} }
#endif #endif