VirtualBox

Ignore:
Timestamp:
Jan 16, 2025 1:09:46 PM (3 weeks ago)
Author:
vboxsync
Message:

libpng-1.6.45: Applied and adjusted our libpng changes to 1.6.45. bugref:8515

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  
     1External contributions to libpng
     2--------------------------------
    13
    24This "contrib" directory contains contributions which are not necessarily under
  • trunk/src/libs/libpng-1.6.45/contrib/examples/README.txt

    r96425 r107813  
    1 
    21This directory (contrib/examples) contains examples of libpng usage.
    32
  • trunk/src/libs/libpng-1.6.45/contrib/libtests/pngimage.c

    r103316 r107813  
    1 
    21/* pngimage.c
    32 *
     
    10201019   C(bit_depth);
    10211020   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
    10231027   C(compression_method);
    10241028   C(filter_method);
  • trunk/src/libs/libpng-1.6.45/contrib/libtests/pngstest.c

    r103316 r107813  
    1 
    21/* pngstest.c
    32 *
     
    35013500   int c;
    35023501
    3503 #if PNG_LIBPNG_VER >= 10700
     3502#if PNG_LIBPNG_VER == 10700
    35043503      /* This error should not exist in 1.7 or later: */
    35053504      opts |= GBG_ERROR;
  • trunk/src/libs/libpng-1.6.45/contrib/libtests/pngunknown.c

    r103316 r107813  
    1 
    21/* pngunknown.c - test the read side unknown chunk handling
    32 *
  • trunk/src/libs/libpng-1.6.45/contrib/libtests/pngvalid.c

    r105469 r107813  
    1 
    21/* pngvalid.c - validate libpng by constructing then reading png files.
    32 *
     
    305304    defined PNG_WRITE_FILTER_SUPPORTED
    306305static void
    307 randomize(void *pv, size_t size)
     306randomize_bytes(void *pv, size_t size)
    308307{
    309308   static png_uint_32 random_seed[2] = {0x56789abc, 0xd};
     
    311310}
    312311
    313 #define R8(this) randomize(&(this), sizeof (this))
     312#define R8(this) randomize_bytes(&(this), sizeof (this))
    314313
    315314#ifdef PNG_READ_SUPPORTED
     
    318317{
    319318   unsigned char b1[1];
    320    randomize(b1, sizeof b1);
     319   randomize_bytes(b1, sizeof b1);
    321320   return b1[0];
    322321}
     
    327326{
    328327   unsigned char b2[2];
    329    randomize(b2, sizeof b2);
     328   randomize_bytes(b2, sizeof b2);
    330329   return png_get_uint_16(b2);
    331330}
     
    337336{
    338337   unsigned char b4[4];
    339    randomize(b4, sizeof b4);
     338   randomize_bytes(b4, sizeof b4);
    340339   return png_get_uint_32(b4);
    341340}
     
    25752574 * algorithm.
    25762575 */
    2577 #define DIGITIZE PNG_LIBPNG_VER < 10700
     2576#define DIGITIZE PNG_LIBPNG_VER != 10700
    25782577
    25792578/* If pm->calculations_use_input_precision is set then operations will happen
     
    39873986#  define set_write_interlace_handling(pp,type) png_set_interlace_handling(pp)
    39883987#  define do_own_interlace 0
    3989 #elif PNG_LIBPNG_VER < 10700
     3988#elif PNG_LIBPNG_VER != 10700
    39903989#  define set_write_interlace_handling(pp,type) (1)
    39913990static void
     
    40154014#endif /* WRITE_INTERLACING tests */
    40164015
    4017 #if PNG_LIBPNG_VER >= 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED
     4016#if PNG_LIBPNG_VER == 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED
    40184017#   define CAN_WRITE_INTERLACE 1
    40194018#else
     
    46344633       /* no warnings makes these errors undetectable prior to 1.7.0 */
    46354634       { sBIT0_error_fn, "sBIT(0): failed to detect error",
    4636          PNG_LIBPNG_VER < 10700 },
     4635         PNG_LIBPNG_VER != 10700 },
    46374636
    46384637       { sBIT_error_fn, "sBIT(too big): failed to detect error",
    4639          PNG_LIBPNG_VER < 10700 },
     4638         PNG_LIBPNG_VER != 10700 },
    46404639    };
    46414640
     
    62376236      if (this->colour_type == PNG_COLOR_TYPE_GRAY)
    62386237      {
    6239 #        if PNG_LIBPNG_VER < 10700
     6238#        if PNG_LIBPNG_VER != 10700
    62406239            if (!for_background && this->bit_depth < 8)
    62416240               this->bit_depth = this->sample_depth = 8;
     
    62476246             * tRNS chunk to expand at this point.
    62486247             */
    6249 #           if PNG_LIBPNG_VER >= 10700
     6248#           if PNG_LIBPNG_VER == 10700
    62506249               if (!for_background && this->bit_depth < 8)
    62516250                  this->bit_depth = this->sample_depth = 8;
     
    71287127   const transform_display *display)
    71297128{
    7130 #if PNG_LIBPNG_VER < 10700
     7129#if PNG_LIBPNG_VER != 10700
    71317130   /* LIBPNG BUG: this always forces palette images to RGB. */
    71327131   if (that->colour_type == PNG_COLOR_TYPE_PALETTE)
     
    71387137    */
    71397138   if (that->have_tRNS)
    7140 #     if PNG_LIBPNG_VER >= 10700
     7139#     if PNG_LIBPNG_VER == 10700
    71417140         if (that->colour_type != PNG_COLOR_TYPE_PALETTE &&
    71427141             (that->colour_type & PNG_COLOR_MASK_ALPHA) == 0)
     
    71447143      image_pixel_add_alpha(that, &display->this, 0/*!for background*/);
    71457144
    7146 #if PNG_LIBPNG_VER < 10700
     7145#if PNG_LIBPNG_VER != 10700
    71477146   /* LIBPNG BUG: otherwise libpng still expands to 8 bits! */
    71487147   else
     
    71737172    */
    71747173   return
    7175 #  if PNG_LIBPNG_VER >= 10700
     7174#  if PNG_LIBPNG_VER == 10700
    71767175      colour_type != PNG_COLOR_TYPE_PALETTE &&
    71777176#  endif
     
    73147313    const transform_display *display)
    73157314{
    7316 #if PNG_LIBPNG_VER < 10700
     7315#if PNG_LIBPNG_VER != 10700
    73177316   image_transform_png_set_expand_mod(this, that, pp, display);
    73187317#else
     
    73307329    const image_transform **that, png_byte colour_type, png_byte bit_depth)
    73317330{
    7332 #if PNG_LIBPNG_VER < 10700
     7331#if PNG_LIBPNG_VER != 10700
    73337332   return image_transform_png_set_expand_add(this, that, colour_type,
    73347333      bit_depth);
     
    73607359
    73617360   /* NOTE: prior to 1.7 libpng does SET_EXPAND as well, so tRNS is expanded. */
    7362 #  if PNG_LIBPNG_VER < 10700
     7361#  if PNG_LIBPNG_VER != 10700
    73637362      if (that->this.has_tRNS)
    73647363         that->this.is_transparent = 1;
     
    74137412{
    74147413   png_set_scale_16(pp);
    7415 #  if PNG_LIBPNG_VER < 10700
     7414#  if PNG_LIBPNG_VER != 10700
    74167415      /* libpng will limit the gamma table size: */
    74177416      that->max_gamma_8 = PNG_MAX_GAMMA_8;
     
    74617460{
    74627461   png_set_strip_16(pp);
    7463 #  if PNG_LIBPNG_VER < 10700
     7462#  if PNG_LIBPNG_VER != 10700
    74647463      /* libpng will limit the gamma table size: */
    74657464      that->max_gamma_8 = PNG_MAX_GAMMA_8;
     
    76487647   {
    76497648      /* The default (built in) coefficients, as above: */
    7650 #     if PNG_LIBPNG_VER < 10700
     7649#     if PNG_LIBPNG_VER != 10700
    76517650         data.red_coefficient = 6968 / 32768.;
    76527651         data.green_coefficient = 23434 / 32768.;
     
    77317730          *  +/-(1<<(15-PNG_MAX_GAMMA_8)) in the 8-bit case.
    77327731          */
    7733 #        if PNG_LIBPNG_VER < 10700
     7732#        if PNG_LIBPNG_VER != 10700
    77347733            if (that->this.bit_depth < 16)
    77357734               that->max_gamma_8 = PNG_MAX_GAMMA_8;
     
    79087907      double gray, err;
    79097908
    7910 #     if PNG_LIBPNG_VER < 10700
     7909#     if PNG_LIBPNG_VER != 10700
    79117910         if (that->colour_type == PNG_COLOR_TYPE_PALETTE)
    79127911            image_pixel_convert_PLTE(that);
     
    80958094         double be = that->bluee;
    80968095
    8097 #        if PNG_LIBPNG_VER < 10700
     8096#        if PNG_LIBPNG_VER != 10700
    80988097            /* The true gray case involves no math in earlier versions (not
    80998098             * true, there was some if gamma correction was happening too.)
     
    98749873             * an sbit less than the bit depth.
    98759874             */
    9876 #           if PNG_LIBPNG_VER < 10700
     9875#           if PNG_LIBPNG_VER != 10700
    98779876#              define SBIT_ERROR .5
    98789877#           else
     
    1073410733#     define PNG_MAX_GAMMA_8 11
    1073510734#  endif
    10736 #  if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER < 10700
     10735#  if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER != 10700
    1073710736#     define SBIT_16_TO_8 PNG_MAX_GAMMA_8
    1073810737#  else
     
    1173711736    * difference.
    1173811737    */
    11739    pm.assume_16_bit_calculations = PNG_LIBPNG_VER >= 10700;
     11738   pm.assume_16_bit_calculations = PNG_LIBPNG_VER == 10700;
    1174011739
    1174111740   /* Currently 16 bit expansion happens at the end of the pipeline, so the
     
    1176111760   pm.test_lbg_gamma_transform = PNG_LIBPNG_VER >= 10600;
    1176211761   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;
    1176411763
    1176511764   /* And the test encodings */
     
    1176711766   pm.nencodings = ARRAY_SIZE(test_encodings);
    1176811767
    11769 #  if PNG_LIBPNG_VER < 10700
     11768#  if PNG_LIBPNG_VER != 10700
    1177011769      pm.sbitlow = 8U; /* because libpng doesn't do sBIT below 8! */
    1177111770#  else
     
    1179711796   pm.maxabs16 = .00005;/* 1/20000 */
    1179811797   pm.maxcalc16 =1./65535;/* +/-1 in 16 bits for compose errors */
    11799 #  if PNG_LIBPNG_VER < 10700
     11798#  if PNG_LIBPNG_VER != 10700
    1180011799      pm.maxcalcG = 1./((1<<PNG_MAX_GAMMA_8)-1);
    1180111800#  else
  • trunk/src/libs/libpng-1.6.45/contrib/libtests/readpng.c

    r103316 r107813  
    1 
    21/* readpng.c
    32 *
  • trunk/src/libs/libpng-1.6.45/contrib/libtests/tarith.c

    r103316 r107813  
    1 
    21/* tarith.c
    32 *
  • trunk/src/libs/libpng-1.6.45/contrib/libtests/timepng.c

    r103316 r107813  
    1 
    21/* timepng.c
    32 *
  • trunk/src/libs/libpng-1.6.45/contrib/mips-msa/linux.c

    r103316 r107813  
    1 
    21/* contrib/mips-msa/linux.c
    32 *
  • trunk/src/libs/libpng-1.6.45/contrib/oss-fuzz/libpng_read_fuzzer.cc

    r103316 r107813  
    1 
    21// libpng_read_fuzzer.cc
    32// Copyright 2017-2018 Glenn Randers-Pehrson
     
    205204
    206205  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
    207222  return 0;
    208223}
  • trunk/src/libs/libpng-1.6.45/contrib/pngminim/README

    r96425 r107813  
    1 
    21This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa
    32to build minimal decoder, encoder, and progressive reader applications.
  • trunk/src/libs/libpng-1.6.45/contrib/pngminus/CHANGES.txt

    r103316 r107813  
    1 
    21pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file
    32copyright (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 
    21pnm2png / png2pnm --- conversion from PBM/PGM/PPM-file to PNG-file
    32
  • trunk/src/libs/libpng-1.6.45/contrib/pngsuite/README

    r96425 r107813  
    1 
    21pngsuite
    32--------
  • trunk/src/libs/libpng-1.6.45/contrib/pngsuite/interlaced/README

    r96425 r107813  
    1 
    21These images fail the "pngimage-quick" and "pngimage-full" tests.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette