< prev index next >

src/java.desktop/share/native/libsplashscreen/libpng/pngread.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
*** 201,210 **** --- 201,215 ---- #ifdef PNG_READ_cHRM_SUPPORTED else if (chunk_name == png_cHRM) png_handle_cHRM(png_ptr, info_ptr, length); #endif + #ifdef PNG_READ_eXIf_SUPPORTED + else if (chunk_name == png_eXIf) + png_handle_eXIf(png_ptr, info_ptr, length); + #endif + #ifdef PNG_READ_gAMA_SUPPORTED else if (chunk_name == png_gAMA) png_handle_gAMA(png_ptr, info_ptr, length); #endif
*** 560,569 **** --- 565,575 ---- if ((png_ptr->mode & PNG_HAVE_IDAT) == 0) png_error(png_ptr, "Invalid attempt to read row data"); /* Fill the row with IDAT data: */ + png_ptr->row_buf[0]=255; /* to force error if no data was found */ png_read_IDAT_data(png_ptr, png_ptr->row_buf, row_info.rowbytes + 1); if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE) { if (png_ptr->row_buf[0] < PNG_FILTER_VALUE_LAST)
*** 868,877 **** --- 874,888 ---- #ifdef PNG_READ_cHRM_SUPPORTED else if (chunk_name == png_cHRM) png_handle_cHRM(png_ptr, info_ptr, length); #endif + #ifdef PNG_READ_eXIf_SUPPORTED + else if (chunk_name == png_eXIf) + png_handle_eXIf(png_ptr, info_ptr, length); + #endif + #ifdef PNG_READ_gAMA_SUPPORTED else if (chunk_name == png_gAMA) png_handle_gAMA(png_ptr, info_ptr, length); #endif
*** 1909,1919 **** */ switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format)) { case 4: entry[afirst ? 0 : 3] = (png_uint_16)alpha; ! /* FALL THROUGH */ case 3: if (alpha < 65535) { if (alpha > 0) --- 1920,1930 ---- */ switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format)) { case 4: entry[afirst ? 0 : 3] = (png_uint_16)alpha; ! /* FALLTHROUGH */ case 3: if (alpha < 65535) { if (alpha > 0)
*** 1931,1941 **** entry[afirst + bgr] = (png_uint_16)red; break; case 2: entry[1 ^ afirst] = (png_uint_16)alpha; ! /* FALL THROUGH */ case 1: if (alpha < 65535) { if (alpha > 0) --- 1942,1952 ---- entry[afirst + bgr] = (png_uint_16)red; break; case 2: entry[1 ^ afirst] = (png_uint_16)alpha; ! /* FALLTHROUGH */ case 1: if (alpha < 65535) { if (alpha > 0)
*** 1960,1977 **** --- 1971,1990 ---- switch (PNG_IMAGE_SAMPLE_CHANNELS(image->format)) { case 4: entry[afirst ? 0 : 3] = (png_byte)alpha; + /* FALLTHROUGH */ case 3: entry[afirst + (2 ^ bgr)] = (png_byte)blue; entry[afirst + 1] = (png_byte)green; entry[afirst + bgr] = (png_byte)red; break; case 2: entry[1 ^ afirst] = (png_byte)alpha; + /* FALLTHROUGH */ case 1: entry[afirst] = (png_byte)green; break; default:
*** 2887,2897 **** switch (data_encoding) { case P_sRGB: /* Change to 8-bit sRGB */ png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB); ! /* FALL THROUGH */ case P_FILE: if (png_ptr->bit_depth > 8) png_set_scale_16(png_ptr); break; --- 2900,2910 ---- switch (data_encoding) { case P_sRGB: /* Change to 8-bit sRGB */ png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB); ! /* FALLTHROUGH */ case P_FILE: if (png_ptr->bit_depth > 8) png_set_scale_16(png_ptr); break;
*** 3205,3216 **** info_ptr->bit_depth == 8 && png_ptr->screen_gamma == PNG_GAMMA_sRGB && image->colormap_entries == 244 /* 216 + 1 + 27 */) break; ! /* goto bad_output; */ ! /* FALL THROUGH */ default: bad_output: png_error(png_ptr, "bad color-map processing (internal error)"); } --- 3218,3228 ---- info_ptr->bit_depth == 8 && png_ptr->screen_gamma == PNG_GAMMA_sRGB && image->colormap_entries == 244 /* 216 + 1 + 27 */) break; ! goto bad_output; default: bad_output: png_error(png_ptr, "bad color-map processing (internal error)"); }
*** 3774,3783 **** --- 3786,3801 ---- { mode = PNG_ALPHA_PNG; output_gamma = PNG_DEFAULT_sRGB; } + if ((change & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0) + { + mode = PNG_ALPHA_OPTIMIZED; + change &= ~PNG_FORMAT_FLAG_ASSOCIATED_ALPHA; + } + /* If 'do_local_background' is set check for the presence of gamma * correction; this is part of the work-round for the libpng bug * described above. * * TODO: fix libpng and remove this.
*** 3999,4008 **** --- 4017,4030 ---- } else if (do_local_compose != 0) /* internal error */ png_error(png_ptr, "png_image_read: alpha channel lost"); + if ((format & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0) { + info_format |= PNG_FORMAT_FLAG_ASSOCIATED_ALPHA; + } + if (info_ptr->bit_depth == 16) info_format |= PNG_FORMAT_FLAG_LINEAR; #ifdef PNG_FORMAT_BGR_SUPPORTED if ((png_ptr->transformations & PNG_BGR) != 0)
< prev index next >