[libpng16] Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes

the Coverity scan without them.
This commit is contained in:
Glenn Randers-Pehrson
2015-03-21 11:54:32 -05:00
parent 2b66107abb
commit c5370ede95
13 changed files with 238 additions and 249 deletions

View File

@@ -56,14 +56,14 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
else
{
mask = 0x80;
*dp = (png_byte)(v & 0xff);
*dp = (png_byte)v;
dp++;
v = 0;
}
}
if (mask != 0x80)
*dp = (png_byte)(v & 0xff);
*dp = (png_byte)v;
break;
}
@@ -90,7 +90,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
if (shift == 0)
{
shift = 6;
*dp = (png_byte)(v & 0xff);
*dp = (png_byte)v;
dp++;
v = 0;
}
@@ -102,7 +102,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
}
if (shift != 6)
*dp = (png_byte)(v & 0xff);
*dp = (png_byte)v;
break;
}
@@ -129,7 +129,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
if (shift == 0)
{
shift = 4;
*dp = (png_byte)(v & 0xff);
*dp = (png_byte)v;
dp++;
v = 0;
}
@@ -141,7 +141,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
}
if (shift != 4)
*dp = (png_byte)(v & 0xff);
*dp = (png_byte)v;
break;
}
@@ -150,9 +150,8 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
break;
}
row_info->bit_depth = (png_byte)(bit_depth & 0xff);
row_info->pixel_depth =
(png_byte)((bit_depth * row_info->channels) & 0xff);
row_info->bit_depth = (png_byte)bit_depth;
row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels);
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
row_info->width);
}
@@ -423,7 +422,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = *(sp++);
*/
sp+=3; dp = sp;
*(dp++) = (png_byte)((255 - *(sp++)) & 0xff);
*(dp++) = (png_byte)(255 - *(sp++));
}
}
@@ -446,8 +445,8 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = *(sp++);
*/
sp+=6; dp = sp;
*(dp++) = (png_byte)((255 - *(sp++)) & 0xff);
*(dp++) = (png_byte)((255 - *(sp++)) & 0xff);
*(dp++) = (png_byte)(255 - *(sp++));
*(dp++) = (png_byte)(255 - *(sp++));
}
}
#endif /* WRITE_16BIT */
@@ -465,7 +464,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
for (i = 0, sp = dp = row; i < row_width; i++)
{
*(dp++) = *(sp++);
*(dp++) = (png_byte)((255 - *(sp++)) & 0xff);
*(dp++) = (png_byte)(255 - *(sp++));
}
}
@@ -484,8 +483,8 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = *(sp++);
*/
sp+=2; dp = sp;
*(dp++) = (png_byte)((255 - *(sp++)) & 0xff);
*(dp++) = (png_byte)((255 - *(sp++)) & 0xff);
*(dp++) = (png_byte)(255 - *(sp++));
*(dp++) = (png_byte)(255 - *(sp++));
}
}
#endif /* WRITE_16BIT */