[libpng16] Fixed a new signed-unsigned comparison in pngrtran.c (Max Stepin).

Removed some useless typecasts from contrib/tools/png-fix-itxt.c
This commit is contained in:
Glenn Randers-Pehrson 2015-07-01 14:06:39 -05:00
parent 4e5ac72254
commit a390897ba4
4 changed files with 17 additions and 13 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.18beta09 - June 30, 2015 Libpng 1.6.18beta09 - July 1, 2015
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.
@ -95,7 +95,9 @@ Version 1.6.18beta08 [June 30, 2015]
be used. be used.
Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h
Version 1.6.18beta09 [June 30, 2015] Version 1.6.18beta09 [July 1, 2015]
Removed some useless typecasts from contrib/tools/png-fix-itxt.c
Fixed a new signed-unsigned comparison in pngrtran.c (Max Stepin).
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

@ -5280,7 +5280,9 @@ Version 1.6.18beta08 [June 30, 2015]
be used. be used.
Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h
Version 1.6.18beta09 [June 30, 2015] Version 1.6.18beta09 [July 1, 2015]
Removed some useless typecasts from contrib/tools/png-fix-itxt.c
Fixed a new signed-unsigned comparison in pngrtran.c (Max Stepin).
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

@ -37,7 +37,7 @@
/* Read one character (inchar), also return octet (c), break if EOF */ /* Read one character (inchar), also return octet (c), break if EOF */
#define GETBREAK inchar=getchar(); \ #define GETBREAK inchar=getchar(); \
c=(inchar & 0xffU);\ c=(inchar & 0xffU);\
if (inchar != (int) c) break if (inchar != c) break
int int
main(void) main(void)
{ {
@ -54,7 +54,7 @@ main(void)
putchar(c); putchar(c);
} }
if (inchar == (int) c) /* !EOF */ if (inchar == c) /* !EOF */
for (;;) for (;;)
{ {
/* Read the length */ /* Read the length */
@ -86,7 +86,7 @@ for (;;)
GETBREAK; buf[i] = c; GETBREAK; buf[i] = c;
} }
if (inchar != (int) c) /* EOF */ if (inchar != c) /* EOF */
break; break;
/* Calculate the CRC */ /* Calculate the CRC */
@ -113,7 +113,7 @@ for (;;)
crc = crc32(crc, buf+7+length, 1); crc = crc32(crc, buf+7+length, 1);
} }
if (inchar != (int) c) /* EOF */ if (inchar != c) /* EOF */
break; break;
/* Update length bytes */ /* Update length bytes */
@ -129,7 +129,7 @@ for (;;)
else else
{ {
if (inchar != (int) c) /* EOF */ if (inchar != c) /* EOF */
break; break;
/* Copy bytes that were already read (length and chunk name) */ /* Copy bytes that were already read (length and chunk name) */
@ -143,7 +143,7 @@ for (;;)
putchar(c); putchar(c);
} }
if (inchar != (int) c) /* EOF */ if (inchar != c) /* EOF */
{ {
break; break;
} }
@ -153,7 +153,7 @@ for (;;)
break; break;
} }
if (inchar != (int) c) /* EOF */ if (inchar != c) /* EOF */
break; break;
if (buf[4] == 73 && buf[5] == 69 && buf[6] == 78 && buf[7] == 68) if (buf[4] == 73 && buf[5] == 69 && buf[6] == 78 && buf[7] == 68)

View File

@ -4460,7 +4460,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
for (i = 0; i < row_width; i++) for (i = 0; i < row_width; i++)
{ {
if ((*sp & 0xff) == gray) if ((*sp & 0xffU) == gray)
*dp-- = 0; *dp-- = 0;
else else
@ -4478,8 +4478,8 @@ png_do_expand(png_row_infop row_info, png_bytep row,
dp = row + (row_info->rowbytes << 1) - 1; dp = row + (row_info->rowbytes << 1) - 1;
for (i = 0; i < row_width; i++) for (i = 0; i < row_width; i++)
{ {
if ((*(sp - 1) & 0xff) == gray_high && if ((*(sp - 1) & 0xffU) == gray_high &&
(*(sp) & 0xff) == gray_low) (*(sp) & 0xffU) == gray_low)
{ {
*dp-- = 0; *dp-- = 0;
*dp-- = 0; *dp-- = 0;