[libpng16] Imported from libpng-1.6.18beta03.tar

This commit is contained in:
Glenn Randers-Pehrson
2015-05-06 14:57:02 -05:00
parent 74428df2fd
commit d8d18fbb02
17 changed files with 38 additions and 33 deletions

View File

@@ -216,8 +216,13 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0 &&
info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
{
int j;
for (j = 0; j<(int)info_ptr->num_trans; j++)
int j, jend;
jend = info_ptr->num_trans;
if (jend > PNG_MAX_PALETTE_LENGTH)
jend = PNG_MAX_PALETTE_LENGTH;
for (j = 0; j<jend; ++j)
info_ptr->trans_alpha[j] =
(png_byte)(255 - info_ptr->trans_alpha[j]);
}