< prev index next >

src/java.desktop/share/native/libsplashscreen/libpng/pngset.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-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.32 [August 24, 2017] ! * Copyright (c) 1998-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
*** 160,169 **** --- 160,216 ---- } # endif /* FLOATING_POINT */ #endif /* cHRM */ + #ifdef PNG_eXIf_SUPPORTED + void PNGAPI + png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr, + const png_bytep eXIf_buf) + { + png_warning(png_ptr, "png_set_eXIf does not work; use png_set_eXIf_1"); + PNG_UNUSED(info_ptr) + PNG_UNUSED(eXIf_buf) + } + + void PNGAPI + png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr, + const png_uint_32 num_exif, const png_bytep eXIf_buf) + { + int i; + + png_debug1(1, "in %s storage function", "eXIf"); + + if (png_ptr == NULL || info_ptr == NULL) + return; + + if (info_ptr->exif) + { + png_free(png_ptr, info_ptr->exif); + info_ptr->exif = NULL; + } + + info_ptr->num_exif = num_exif; + + info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr, + info_ptr->num_exif)); + + if (info_ptr->exif == NULL) + { + png_warning(png_ptr, "Insufficient memory for eXIf chunk data"); + return; + } + + info_ptr->free_me |= PNG_FREE_EXIF; + + for (i = 0; i < (int) info_ptr->num_exif; i++) + info_ptr->exif[i] = eXIf_buf[i]; + + info_ptr->valid |= PNG_INFO_eXIf; + } + #endif /* eXIf */ + #ifdef PNG_gAMA_SUPPORTED void PNGFAPI png_set_gAMA_fixed(png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point file_gamma) {
*** 1128,1139 **** * count, so an invalid entry is not added. */ info_ptr->valid |= PNG_INFO_sPLT; ++(info_ptr->splt_palettes_num); ++np; } ! while (++entries, --nentries); if (nentries > 0) png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR); } #endif /* sPLT */ --- 1175,1187 ---- * count, so an invalid entry is not added. */ info_ptr->valid |= PNG_INFO_sPLT; ++(info_ptr->splt_palettes_num); ++np; + ++entries; } ! while (--nentries); if (nentries > 0) png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR); } #endif /* sPLT */
*** 1380,1389 **** --- 1428,1438 ---- * libpng except for IHDR, PLTE, tRNS, IDAT, and IEND */ static PNG_CONST png_byte chunks_to_ignore[] = { 98, 75, 71, 68, '\0', /* bKGD */ 99, 72, 82, 77, '\0', /* cHRM */ + 101, 88, 73, 102, '\0', /* eXIf */ 103, 65, 77, 65, '\0', /* gAMA */ 104, 73, 83, 84, '\0', /* hIST */ 105, 67, 67, 80, '\0', /* iCCP */ 105, 84, 88, 116, '\0', /* iTXt */ 111, 70, 70, 115, '\0', /* oFFs */
*** 1722,1739 **** while (*key && key_len < 79) { png_byte ch = (png_byte)*key++; if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/)) ! *new_key++ = ch, ++key_len, space = 0; else if (space == 0) { /* A space or an invalid character when one wasn't seen immediately * before; output just a space. */ ! *new_key++ = 32, ++key_len, space = 1; /* If the character was not a space then it is invalid. */ if (ch != 32) bad_character = ch; } --- 1771,1790 ---- while (*key && key_len < 79) { png_byte ch = (png_byte)*key++; if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/)) ! { ! *new_key++ = ch; ++key_len; space = 0; ! } else if (space == 0) { /* A space or an invalid character when one wasn't seen immediately * before; output just a space. */ ! *new_key++ = 32; ++key_len; space = 1; /* If the character was not a space then it is invalid. */ if (ch != 32) bad_character = ch; }
*** 1742,1752 **** bad_character = ch; /* just skip it, record the first error */ } if (key_len > 0 && space != 0) /* trailing space */ { ! --key_len, --new_key; if (bad_character == 0) bad_character = 32; } /* Terminate the keyword */ --- 1793,1803 ---- bad_character = ch; /* just skip it, record the first error */ } if (key_len > 0 && space != 0) /* trailing space */ { ! --key_len; --new_key; if (bad_character == 0) bad_character = 32; } /* Terminate the keyword */
< prev index next >