[libpng16] Imported from libpng-1.6.4beta01.tar

This commit is contained in:
Glenn Randers-Pehrson
2013-08-21 18:01:32 -05:00
parent 685d79e27a
commit 324402044f
19 changed files with 57 additions and 49 deletions

View File

@@ -1884,31 +1884,34 @@ png_init_read_transformations(png_structrp png_ptr)
* the number of significant bits is 0 then no shift is done (this is an
* error condition which is silently ignored.)
*/
if (shift > 0 && shift < 8) for (i=0; i<istop; ++i)
{
int component = png_ptr->palette[i].red;
if (shift > 0 && shift < 8)
for (i=0; i<istop; ++i)
{
int component = png_ptr->palette[i].red;
component >>= shift;
png_ptr->palette[i].red = (png_byte)component;
}
component >>= shift;
png_ptr->palette[i].red = (png_byte)component;
}
shift = 8 - png_ptr->sig_bit.green;
if (shift > 0 && shift < 8) for (i=0; i<istop; ++i)
{
int component = png_ptr->palette[i].green;
if (shift > 0 && shift < 8)
for (i=0; i<istop; ++i)
{
int component = png_ptr->palette[i].green;
component >>= shift;
png_ptr->palette[i].green = (png_byte)component;
}
component >>= shift;
png_ptr->palette[i].green = (png_byte)component;
}
shift = 8 - png_ptr->sig_bit.blue;
if (shift > 0 && shift < 8) for (i=0; i<istop; ++i)
{
int component = png_ptr->palette[i].blue;
if (shift > 0 && shift < 8)
for (i=0; i<istop; ++i)
{
int component = png_ptr->palette[i].blue;
component >>= shift;
png_ptr->palette[i].blue = (png_byte)component;
}
component >>= shift;
png_ptr->palette[i].blue = (png_byte)component;
}
}
#endif /* PNG_READ_SHIFT_SUPPORTED */
}