< prev index next >
src/java.desktop/share/native/libsplashscreen/libpng/pngtrans.c
Print this page
*** 27,38 ****
* This file is available under and governed by the GNU General Public
* License version 2 only, as published by the Free Software Foundation.
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
! * Last changed in libpng 1.6.26 [October 20, 2016]
! * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
--- 27,38 ----
* This file is available under and governed by the GNU General Public
* License version 2 only, as published by the Free Software Foundation.
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
! * Last changed in libpng 1.6.33 [September 28, 2017]
! * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
*** 540,567 ****
if (row_info->bit_depth == 8)
{
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channel and, for sp, the filler */
! sp += 2, ++dp;
/* For a 1 pixel wide image there is nothing to do */
while (sp < ep)
! *dp++ = *sp, sp += 2;
row_info->pixel_depth = 8;
}
else if (row_info->bit_depth == 16)
{
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channel and, for sp, the filler */
! sp += 4, dp += 2;
while (sp < ep)
! *dp++ = *sp++, *dp++ = *sp, sp += 3;
row_info->pixel_depth = 16;
}
else
--- 540,575 ----
if (row_info->bit_depth == 8)
{
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channel and, for sp, the filler */
! {
! sp += 2; ++dp;
! }
/* For a 1 pixel wide image there is nothing to do */
while (sp < ep)
! {
! *dp++ = *sp; sp += 2;
! }
row_info->pixel_depth = 8;
}
else if (row_info->bit_depth == 16)
{
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channel and, for sp, the filler */
! {
! sp += 4; dp += 2;
! }
while (sp < ep)
! {
! *dp++ = *sp++; *dp++ = *sp; sp += 3;
! }
row_info->pixel_depth = 16;
}
else
*** 580,611 ****
if (row_info->bit_depth == 8)
{
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channels and, for sp, the filler */
! sp += 4, dp += 3;
/* Note that the loop adds 3 to dp and 4 to sp each time. */
while (sp < ep)
! *dp++ = *sp++, *dp++ = *sp++, *dp++ = *sp, sp += 2;
row_info->pixel_depth = 24;
}
else if (row_info->bit_depth == 16)
{
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channels and, for sp, the filler */
! sp += 8, dp += 6;
while (sp < ep)
{
/* Copy 6 bytes, skip 2 */
! *dp++ = *sp++, *dp++ = *sp++;
! *dp++ = *sp++, *dp++ = *sp++;
! *dp++ = *sp++, *dp++ = *sp, sp += 3;
}
row_info->pixel_depth = 48;
}
--- 588,625 ----
if (row_info->bit_depth == 8)
{
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channels and, for sp, the filler */
! {
! sp += 4; dp += 3;
! }
/* Note that the loop adds 3 to dp and 4 to sp each time. */
while (sp < ep)
! {
! *dp++ = *sp++; *dp++ = *sp++; *dp++ = *sp; sp += 2;
! }
row_info->pixel_depth = 24;
}
else if (row_info->bit_depth == 16)
{
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channels and, for sp, the filler */
! {
! sp += 8; dp += 6;
! }
while (sp < ep)
{
/* Copy 6 bytes, skip 2 */
! *dp++ = *sp++; *dp++ = *sp++;
! *dp++ = *sp++; *dp++ = *sp++;
! *dp++ = *sp++; *dp++ = *sp; sp += 3;
}
row_info->pixel_depth = 48;
}
*** 621,631 ****
else
return; /* The filler channel has gone already */
/* Fix the rowbytes value. */
! row_info->rowbytes = (unsigned int)(dp-row);
}
#endif
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
/* Swaps red and blue bytes within a pixel */
--- 635,645 ----
else
return; /* The filler channel has gone already */
/* Fix the rowbytes value. */
! row_info->rowbytes = (png_size_t)(dp-row);
}
#endif
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
/* Swaps red and blue bytes within a pixel */
*** 720,730 ****
* an 'int' because pixel_depth becomes an 'int' in the expression below,
* and this calculation is used because it avoids warnings that other
* forms produced on either GCC or MSVC.
*/
int padding = PNG_PADBITS(row_info->pixel_depth, row_info->width);
! png_bytep rp = png_ptr->row_buf + row_info->rowbytes;
switch (row_info->bit_depth)
{
case 1:
{
--- 734,744 ----
* an 'int' because pixel_depth becomes an 'int' in the expression below,
* and this calculation is used because it avoids warnings that other
* forms produced on either GCC or MSVC.
*/
int padding = PNG_PADBITS(row_info->pixel_depth, row_info->width);
! png_bytep rp = png_ptr->row_buf + row_info->rowbytes - 1;
switch (row_info->bit_depth)
{
case 1:
{
< prev index next >