Changeset 107813 in vbox for trunk/src/libs/libpng-1.6.45/contrib
- Timestamp:
- Jan 16, 2025 1:09:46 PM (3 weeks ago)
- Location:
- trunk/src/libs/libpng-1.6.45/contrib
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/libpng-1.6.45/contrib/README.txt
r96425 r107813 1 External contributions to libpng 2 -------------------------------- 1 3 2 4 This "contrib" directory contains contributions which are not necessarily under -
trunk/src/libs/libpng-1.6.45/contrib/examples/README.txt
r96425 r107813 1 2 1 This directory (contrib/examples) contains examples of libpng usage. 3 2 -
trunk/src/libs/libpng-1.6.45/contrib/libtests/pngimage.c
r103316 r107813 1 2 1 /* pngimage.c 3 2 * … … 1020 1019 C(bit_depth); 1021 1020 C(color_type); 1022 C(interlace_method); 1021 # ifdef PNG_WRITE_INTERLACING_SUPPORTED 1022 /* If write interlace has been disabled, the PNG file is still 1023 * written correctly, but as a regular (not-interlaced) PNG. 1024 */ 1025 C(interlace_method); 1026 # endif 1023 1027 C(compression_method); 1024 1028 C(filter_method); -
trunk/src/libs/libpng-1.6.45/contrib/libtests/pngstest.c
r103316 r107813 1 2 1 /* pngstest.c 3 2 * … … 3501 3500 int c; 3502 3501 3503 #if PNG_LIBPNG_VER >= 107003502 #if PNG_LIBPNG_VER == 10700 3504 3503 /* This error should not exist in 1.7 or later: */ 3505 3504 opts |= GBG_ERROR; -
trunk/src/libs/libpng-1.6.45/contrib/libtests/pngunknown.c
r103316 r107813 1 2 1 /* pngunknown.c - test the read side unknown chunk handling 3 2 * -
trunk/src/libs/libpng-1.6.45/contrib/libtests/pngvalid.c
r105469 r107813 1 2 1 /* pngvalid.c - validate libpng by constructing then reading png files. 3 2 * … … 305 304 defined PNG_WRITE_FILTER_SUPPORTED 306 305 static void 307 randomize (void *pv, size_t size)306 randomize_bytes(void *pv, size_t size) 308 307 { 309 308 static png_uint_32 random_seed[2] = {0x56789abc, 0xd}; … … 311 310 } 312 311 313 #define R8(this) randomize (&(this), sizeof (this))312 #define R8(this) randomize_bytes(&(this), sizeof (this)) 314 313 315 314 #ifdef PNG_READ_SUPPORTED … … 318 317 { 319 318 unsigned char b1[1]; 320 randomize (b1, sizeof b1);319 randomize_bytes(b1, sizeof b1); 321 320 return b1[0]; 322 321 } … … 327 326 { 328 327 unsigned char b2[2]; 329 randomize (b2, sizeof b2);328 randomize_bytes(b2, sizeof b2); 330 329 return png_get_uint_16(b2); 331 330 } … … 337 336 { 338 337 unsigned char b4[4]; 339 randomize (b4, sizeof b4);338 randomize_bytes(b4, sizeof b4); 340 339 return png_get_uint_32(b4); 341 340 } … … 2575 2574 * algorithm. 2576 2575 */ 2577 #define DIGITIZE PNG_LIBPNG_VER <107002576 #define DIGITIZE PNG_LIBPNG_VER != 10700 2578 2577 2579 2578 /* If pm->calculations_use_input_precision is set then operations will happen … … 3987 3986 # define set_write_interlace_handling(pp,type) png_set_interlace_handling(pp) 3988 3987 # define do_own_interlace 0 3989 #elif PNG_LIBPNG_VER <107003988 #elif PNG_LIBPNG_VER != 10700 3990 3989 # define set_write_interlace_handling(pp,type) (1) 3991 3990 static void … … 4015 4014 #endif /* WRITE_INTERLACING tests */ 4016 4015 4017 #if PNG_LIBPNG_VER >= 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED4016 #if PNG_LIBPNG_VER == 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED 4018 4017 # define CAN_WRITE_INTERLACE 1 4019 4018 #else … … 4634 4633 /* no warnings makes these errors undetectable prior to 1.7.0 */ 4635 4634 { sBIT0_error_fn, "sBIT(0): failed to detect error", 4636 PNG_LIBPNG_VER <10700 },4635 PNG_LIBPNG_VER != 10700 }, 4637 4636 4638 4637 { sBIT_error_fn, "sBIT(too big): failed to detect error", 4639 PNG_LIBPNG_VER <10700 },4638 PNG_LIBPNG_VER != 10700 }, 4640 4639 }; 4641 4640 … … 6237 6236 if (this->colour_type == PNG_COLOR_TYPE_GRAY) 6238 6237 { 6239 # if PNG_LIBPNG_VER <107006238 # if PNG_LIBPNG_VER != 10700 6240 6239 if (!for_background && this->bit_depth < 8) 6241 6240 this->bit_depth = this->sample_depth = 8; … … 6247 6246 * tRNS chunk to expand at this point. 6248 6247 */ 6249 # if PNG_LIBPNG_VER >= 107006248 # if PNG_LIBPNG_VER == 10700 6250 6249 if (!for_background && this->bit_depth < 8) 6251 6250 this->bit_depth = this->sample_depth = 8; … … 7128 7127 const transform_display *display) 7129 7128 { 7130 #if PNG_LIBPNG_VER <107007129 #if PNG_LIBPNG_VER != 10700 7131 7130 /* LIBPNG BUG: this always forces palette images to RGB. */ 7132 7131 if (that->colour_type == PNG_COLOR_TYPE_PALETTE) … … 7138 7137 */ 7139 7138 if (that->have_tRNS) 7140 # if PNG_LIBPNG_VER >= 107007139 # if PNG_LIBPNG_VER == 10700 7141 7140 if (that->colour_type != PNG_COLOR_TYPE_PALETTE && 7142 7141 (that->colour_type & PNG_COLOR_MASK_ALPHA) == 0) … … 7144 7143 image_pixel_add_alpha(that, &display->this, 0/*!for background*/); 7145 7144 7146 #if PNG_LIBPNG_VER <107007145 #if PNG_LIBPNG_VER != 10700 7147 7146 /* LIBPNG BUG: otherwise libpng still expands to 8 bits! */ 7148 7147 else … … 7173 7172 */ 7174 7173 return 7175 # if PNG_LIBPNG_VER >= 107007174 # if PNG_LIBPNG_VER == 10700 7176 7175 colour_type != PNG_COLOR_TYPE_PALETTE && 7177 7176 # endif … … 7314 7313 const transform_display *display) 7315 7314 { 7316 #if PNG_LIBPNG_VER <107007315 #if PNG_LIBPNG_VER != 10700 7317 7316 image_transform_png_set_expand_mod(this, that, pp, display); 7318 7317 #else … … 7330 7329 const image_transform **that, png_byte colour_type, png_byte bit_depth) 7331 7330 { 7332 #if PNG_LIBPNG_VER <107007331 #if PNG_LIBPNG_VER != 10700 7333 7332 return image_transform_png_set_expand_add(this, that, colour_type, 7334 7333 bit_depth); … … 7360 7359 7361 7360 /* NOTE: prior to 1.7 libpng does SET_EXPAND as well, so tRNS is expanded. */ 7362 # if PNG_LIBPNG_VER <107007361 # if PNG_LIBPNG_VER != 10700 7363 7362 if (that->this.has_tRNS) 7364 7363 that->this.is_transparent = 1; … … 7413 7412 { 7414 7413 png_set_scale_16(pp); 7415 # if PNG_LIBPNG_VER <107007414 # if PNG_LIBPNG_VER != 10700 7416 7415 /* libpng will limit the gamma table size: */ 7417 7416 that->max_gamma_8 = PNG_MAX_GAMMA_8; … … 7461 7460 { 7462 7461 png_set_strip_16(pp); 7463 # if PNG_LIBPNG_VER <107007462 # if PNG_LIBPNG_VER != 10700 7464 7463 /* libpng will limit the gamma table size: */ 7465 7464 that->max_gamma_8 = PNG_MAX_GAMMA_8; … … 7648 7647 { 7649 7648 /* The default (built in) coefficients, as above: */ 7650 # if PNG_LIBPNG_VER <107007649 # if PNG_LIBPNG_VER != 10700 7651 7650 data.red_coefficient = 6968 / 32768.; 7652 7651 data.green_coefficient = 23434 / 32768.; … … 7731 7730 * +/-(1<<(15-PNG_MAX_GAMMA_8)) in the 8-bit case. 7732 7731 */ 7733 # if PNG_LIBPNG_VER <107007732 # if PNG_LIBPNG_VER != 10700 7734 7733 if (that->this.bit_depth < 16) 7735 7734 that->max_gamma_8 = PNG_MAX_GAMMA_8; … … 7908 7907 double gray, err; 7909 7908 7910 # if PNG_LIBPNG_VER <107007909 # if PNG_LIBPNG_VER != 10700 7911 7910 if (that->colour_type == PNG_COLOR_TYPE_PALETTE) 7912 7911 image_pixel_convert_PLTE(that); … … 8095 8094 double be = that->bluee; 8096 8095 8097 # if PNG_LIBPNG_VER <107008096 # if PNG_LIBPNG_VER != 10700 8098 8097 /* The true gray case involves no math in earlier versions (not 8099 8098 * true, there was some if gamma correction was happening too.) … … 9874 9873 * an sbit less than the bit depth. 9875 9874 */ 9876 # if PNG_LIBPNG_VER <107009875 # if PNG_LIBPNG_VER != 10700 9877 9876 # define SBIT_ERROR .5 9878 9877 # else … … 10734 10733 # define PNG_MAX_GAMMA_8 11 10735 10734 # endif 10736 # if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER <1070010735 # if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER != 10700 10737 10736 # define SBIT_16_TO_8 PNG_MAX_GAMMA_8 10738 10737 # else … … 11737 11736 * difference. 11738 11737 */ 11739 pm.assume_16_bit_calculations = PNG_LIBPNG_VER >= 10700;11738 pm.assume_16_bit_calculations = PNG_LIBPNG_VER == 10700; 11740 11739 11741 11740 /* Currently 16 bit expansion happens at the end of the pipeline, so the … … 11761 11760 pm.test_lbg_gamma_transform = PNG_LIBPNG_VER >= 10600; 11762 11761 pm.test_lbg_gamma_sbit = 1; 11763 pm.test_lbg_gamma_composition = PNG_LIBPNG_VER >= 10700;11762 pm.test_lbg_gamma_composition = PNG_LIBPNG_VER == 10700; 11764 11763 11765 11764 /* And the test encodings */ … … 11767 11766 pm.nencodings = ARRAY_SIZE(test_encodings); 11768 11767 11769 # if PNG_LIBPNG_VER <1070011768 # if PNG_LIBPNG_VER != 10700 11770 11769 pm.sbitlow = 8U; /* because libpng doesn't do sBIT below 8! */ 11771 11770 # else … … 11797 11796 pm.maxabs16 = .00005;/* 1/20000 */ 11798 11797 pm.maxcalc16 =1./65535;/* +/-1 in 16 bits for compose errors */ 11799 # if PNG_LIBPNG_VER <1070011798 # if PNG_LIBPNG_VER != 10700 11800 11799 pm.maxcalcG = 1./((1<<PNG_MAX_GAMMA_8)-1); 11801 11800 # else -
trunk/src/libs/libpng-1.6.45/contrib/libtests/readpng.c
r103316 r107813 1 2 1 /* readpng.c 3 2 * -
trunk/src/libs/libpng-1.6.45/contrib/libtests/tarith.c
r103316 r107813 1 2 1 /* tarith.c 3 2 * -
trunk/src/libs/libpng-1.6.45/contrib/libtests/timepng.c
r103316 r107813 1 2 1 /* timepng.c 3 2 * -
trunk/src/libs/libpng-1.6.45/contrib/mips-msa/linux.c
r103316 r107813 1 2 1 /* contrib/mips-msa/linux.c 3 2 * -
trunk/src/libs/libpng-1.6.45/contrib/oss-fuzz/libpng_read_fuzzer.cc
r103316 r107813 1 2 1 // libpng_read_fuzzer.cc 3 2 // Copyright 2017-2018 Glenn Randers-Pehrson … … 205 204 206 205 PNG_CLEANUP 206 207 #ifdef PNG_SIMPLIFIED_READ_SUPPORTED 208 // Simplified READ API 209 png_image image; 210 memset(&image, 0, (sizeof image)); 211 image.version = PNG_IMAGE_VERSION; 212 213 if (!png_image_begin_read_from_memory(&image, data, size)) { 214 return 0; 215 } 216 217 image.format = PNG_FORMAT_RGBA; 218 std::vector<png_byte> buffer(PNG_IMAGE_SIZE(image)); 219 png_image_finish_read(&image, NULL, buffer.data(), 0, NULL); 220 #endif 221 207 222 return 0; 208 223 } -
trunk/src/libs/libpng-1.6.45/contrib/pngminim/README
r96425 r107813 1 2 1 This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa 3 2 to build minimal decoder, encoder, and progressive reader applications. -
trunk/src/libs/libpng-1.6.45/contrib/pngminus/CHANGES.txt
r103316 r107813 1 2 1 pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file 3 2 copyright (C) 1999-2019 by Willem van Schaik <willem at schaik dot com> -
trunk/src/libs/libpng-1.6.45/contrib/pngminus/LICENSE.txt
r103316 r107813 1 2 1 pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file 3 2 -
trunk/src/libs/libpng-1.6.45/contrib/pngsuite/README
r96425 r107813 1 2 1 pngsuite 3 2 -------- -
trunk/src/libs/libpng-1.6.45/contrib/pngsuite/interlaced/README
r96425 r107813 1 2 1 These images fail the "pngimage-quick" and "pngimage-full" tests.
Note:
See TracChangeset
for help on using the changeset viewer.