1 /*
   2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3  *
   4  * This code is free software; you can redistribute it and/or modify it
   5  * under the terms of the GNU General Public License version 2 only, as
   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 /* pngstruct.h - header file for PNG reference library
  26  *
  27  * Copyright (c) 2018-2019 Cosmin Truta
  28  * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
  29  * Copyright (c) 1996-1997 Andreas Dilger
  30  * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
  31  *
  32  * This code is released under the libpng license.
  33  * For conditions of distribution and use, see the disclaimer
  34  * and license in png.h
  35  */
  36 
  37 /* The structure that holds the information to read and write PNG files.
  38  * The only people who need to care about what is inside of this are the
  39  * people who will be modifying the library for their own special needs.
  40  * It should NOT be accessed directly by an application.
  41  */
  42 
  43 #ifndef PNGSTRUCT_H
  44 #define PNGSTRUCT_H
  45 /* zlib.h defines the structure z_stream, an instance of which is included
  46  * in this structure and is required for decompressing the LZ compressed
  47  * data in PNG files.
  48  */
  49 #ifndef ZLIB_CONST
  50    /* We must ensure that zlib uses 'const' in declarations. */
  51 #  define ZLIB_CONST
  52 #endif
  53 #include "zlib.h"
  54 #ifdef const
  55    /* zlib.h sometimes #defines const to nothing, undo this. */
  56 #  undef const
  57 #endif
  58 
  59 /* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility
  60  * with older builds.
  61  */
  62 #if ZLIB_VERNUM < 0x1260
  63 #  define PNGZ_MSG_CAST(s) png_constcast(char*,s)
  64 #  define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b)
  65 #else
  66 #  define PNGZ_MSG_CAST(s) (s)
  67 #  define PNGZ_INPUT_CAST(b) (b)
  68 #endif
  69 
  70 /* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib
  71  * can handle at once.  This type need be no larger than 16 bits (so maximum of
  72  * 65535), this define allows us to discover how big it is, but limited by the
  73  * maximum for size_t.  The value can be overridden in a library build
  74  * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably
  75  * lower value (e.g. 255 works).  A lower value may help memory usage (slightly)
  76  * and may even improve performance on some systems (and degrade it on others.)
  77  */
  78 #ifndef ZLIB_IO_MAX
  79 #  define ZLIB_IO_MAX ((uInt)-1)
  80 #endif
  81 
  82 #ifdef PNG_WRITE_SUPPORTED
  83 /* The type of a compression buffer list used by the write code. */
  84 typedef struct png_compression_buffer
  85 {
  86    struct png_compression_buffer *next;
  87    png_byte                       output[1]; /* actually zbuf_size */
  88 } png_compression_buffer, *png_compression_bufferp;
  89 
  90 #define PNG_COMPRESSION_BUFFER_SIZE(pp)\
  91    (offsetof(png_compression_buffer, output) + (pp)->zbuffer_size)
  92 #endif
  93 
  94 /* Colorspace support; structures used in png_struct, png_info and in internal
  95  * functions to hold and communicate information about the color space.
  96  *
  97  * PNG_COLORSPACE_SUPPORTED is only required if the application will perform
  98  * colorspace corrections, otherwise all the colorspace information can be
  99  * skipped and the size of libpng can be reduced (significantly) by compiling
 100  * out the colorspace support.
 101  */
 102 #ifdef PNG_COLORSPACE_SUPPORTED
 103 /* The chromaticities of the red, green and blue colorants and the chromaticity
 104  * of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)).
 105  */
 106 typedef struct png_xy
 107 {
 108    png_fixed_point redx, redy;
 109    png_fixed_point greenx, greeny;
 110    png_fixed_point bluex, bluey;
 111    png_fixed_point whitex, whitey;
 112 } png_xy;
 113 
 114 /* The same data as above but encoded as CIE XYZ values.  When this data comes
 115  * from chromaticities the sum of the Y values is assumed to be 1.0
 116  */
 117 typedef struct png_XYZ
 118 {
 119    png_fixed_point red_X, red_Y, red_Z;
 120    png_fixed_point green_X, green_Y, green_Z;
 121    png_fixed_point blue_X, blue_Y, blue_Z;
 122 } png_XYZ;
 123 #endif /* COLORSPACE */
 124 
 125 #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
 126 /* A colorspace is all the above plus, potentially, profile information;
 127  * however at present libpng does not use the profile internally so it is only
 128  * stored in the png_info struct (if iCCP is supported.)  The rendering intent
 129  * is retained here and is checked.
 130  *
 131  * The file gamma encoding information is also stored here and gamma correction
 132  * is done by libpng, whereas color correction must currently be done by the
 133  * application.
 134  */
 135 typedef struct png_colorspace
 136 {
 137 #ifdef PNG_GAMMA_SUPPORTED
 138    png_fixed_point gamma;        /* File gamma */
 139 #endif
 140 
 141 #ifdef PNG_COLORSPACE_SUPPORTED
 142    png_xy      end_points_xy;    /* End points as chromaticities */
 143    png_XYZ     end_points_XYZ;   /* End points as CIE XYZ colorant values */
 144    png_uint_16 rendering_intent; /* Rendering intent of a profile */
 145 #endif
 146 
 147    /* Flags are always defined to simplify the code. */
 148    png_uint_16 flags;            /* As defined below */
 149 } png_colorspace, * PNG_RESTRICT png_colorspacerp;
 150 
 151 typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp;
 152 
 153 /* General flags for the 'flags' field */
 154 #define PNG_COLORSPACE_HAVE_GAMMA           0x0001
 155 #define PNG_COLORSPACE_HAVE_ENDPOINTS       0x0002
 156 #define PNG_COLORSPACE_HAVE_INTENT          0x0004
 157 #define PNG_COLORSPACE_FROM_gAMA            0x0008
 158 #define PNG_COLORSPACE_FROM_cHRM            0x0010
 159 #define PNG_COLORSPACE_FROM_sRGB            0x0020
 160 #define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040
 161 #define PNG_COLORSPACE_MATCHES_sRGB         0x0080 /* exact match on profile */
 162 #define PNG_COLORSPACE_INVALID              0x8000
 163 #define PNG_COLORSPACE_CANCEL(flags)        (0xffff ^ (flags))
 164 #endif /* COLORSPACE || GAMMA */
 165 
 166 struct png_struct_def
 167 {
 168 #ifdef PNG_SETJMP_SUPPORTED
 169    jmp_buf jmp_buf_local;     /* New name in 1.6.0 for jmp_buf in png_struct */
 170    png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */
 171    jmp_buf *jmp_buf_ptr;      /* passed to longjmp_fn */
 172    size_t jmp_buf_size;       /* size of the above, if allocated */
 173 #endif
 174    png_error_ptr error_fn;    /* function for printing errors and aborting */
 175 #ifdef PNG_WARNINGS_SUPPORTED
 176    png_error_ptr warning_fn;  /* function for printing warnings */
 177 #endif
 178    png_voidp error_ptr;       /* user supplied struct for error functions */
 179    png_rw_ptr write_data_fn;  /* function for writing output data */
 180    png_rw_ptr read_data_fn;   /* function for reading input data */
 181    png_voidp io_ptr;          /* ptr to application struct for I/O functions */
 182 
 183 #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
 184    png_user_transform_ptr read_user_transform_fn; /* user read transform */
 185 #endif
 186 
 187 #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
 188    png_user_transform_ptr write_user_transform_fn; /* user write transform */
 189 #endif
 190 
 191 /* These were added in libpng-1.0.2 */
 192 #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
 193 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
 194     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
 195    png_voidp user_transform_ptr; /* user supplied struct for user transform */
 196    png_byte user_transform_depth;    /* bit depth of user transformed pixels */
 197    png_byte user_transform_channels; /* channels in user transformed pixels */
 198 #endif
 199 #endif
 200 
 201    png_uint_32 mode;          /* tells us where we are in the PNG file */
 202    png_uint_32 flags;         /* flags indicating various things to libpng */
 203    png_uint_32 transformations; /* which transformations to perform */
 204 
 205    png_uint_32 zowner;        /* ID (chunk type) of zstream owner, 0 if none */
 206    z_stream    zstream;       /* decompression structure */
 207 
 208 #ifdef PNG_WRITE_SUPPORTED
 209    png_compression_bufferp zbuffer_list; /* Created on demand during write */
 210    uInt                    zbuffer_size; /* size of the actual buffer */
 211 
 212    int zlib_level;            /* holds zlib compression level */
 213    int zlib_method;           /* holds zlib compression method */
 214    int zlib_window_bits;      /* holds zlib compression window bits */
 215    int zlib_mem_level;        /* holds zlib compression memory level */
 216    int zlib_strategy;         /* holds zlib compression strategy */
 217 #endif
 218 /* Added at libpng 1.5.4 */
 219 #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
 220    int zlib_text_level;            /* holds zlib compression level */
 221    int zlib_text_method;           /* holds zlib compression method */
 222    int zlib_text_window_bits;      /* holds zlib compression window bits */
 223    int zlib_text_mem_level;        /* holds zlib compression memory level */
 224    int zlib_text_strategy;         /* holds zlib compression strategy */
 225 #endif
 226 /* End of material added at libpng 1.5.4 */
 227 /* Added at libpng 1.6.0 */
 228 #ifdef PNG_WRITE_SUPPORTED
 229    int zlib_set_level;        /* Actual values set into the zstream on write */
 230    int zlib_set_method;
 231    int zlib_set_window_bits;
 232    int zlib_set_mem_level;
 233    int zlib_set_strategy;
 234 #endif
 235 
 236    png_uint_32 width;         /* width of image in pixels */
 237    png_uint_32 height;        /* height of image in pixels */
 238    png_uint_32 num_rows;      /* number of rows in current pass */
 239    png_uint_32 usr_width;     /* width of row at start of write */
 240    size_t rowbytes;           /* size of row in bytes */
 241    png_uint_32 iwidth;        /* width of current interlaced row in pixels */
 242    png_uint_32 row_number;    /* current row in interlace pass */
 243    png_uint_32 chunk_name;    /* PNG_CHUNK() id of current chunk */
 244    png_bytep prev_row;        /* buffer to save previous (unfiltered) row.
 245                                * While reading this is a pointer into
 246                                * big_prev_row; while writing it is separately
 247                                * allocated if needed.
 248                                */
 249    png_bytep row_buf;         /* buffer to save current (unfiltered) row.
 250                                * While reading, this is a pointer into
 251                                * big_row_buf; while writing it is separately
 252                                * allocated.
 253                                */
 254 #ifdef PNG_WRITE_FILTER_SUPPORTED
 255    png_bytep try_row;    /* buffer to save trial row when filtering */
 256    png_bytep tst_row;    /* buffer to save best trial row when filtering */
 257 #endif
 258    size_t info_rowbytes;      /* Added in 1.5.4: cache of updated row bytes */
 259 
 260    png_uint_32 idat_size;     /* current IDAT size for read */
 261    png_uint_32 crc;           /* current chunk CRC value */
 262    png_colorp palette;        /* palette from the input file */
 263    png_uint_16 num_palette;   /* number of color entries in palette */
 264 
 265 /* Added at libpng-1.5.10 */
 266 #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
 267    int num_palette_max;       /* maximum palette index found in IDAT */
 268 #endif
 269 
 270    png_uint_16 num_trans;     /* number of transparency values */
 271    png_byte compression;      /* file compression type (always 0) */
 272    png_byte filter;           /* file filter type (always 0) */
 273    png_byte interlaced;       /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
 274    png_byte pass;             /* current interlace pass (0 - 6) */
 275    png_byte do_filter;        /* row filter flags (see PNG_FILTER_ in png.h ) */
 276    png_byte color_type;       /* color type of file */
 277    png_byte bit_depth;        /* bit depth of file */
 278    png_byte usr_bit_depth;    /* bit depth of users row: write only */
 279    png_byte pixel_depth;      /* number of bits per pixel */
 280    png_byte channels;         /* number of channels in file */
 281 #ifdef PNG_WRITE_SUPPORTED
 282    png_byte usr_channels;     /* channels at start of write: write only */
 283 #endif
 284    png_byte sig_bytes;        /* magic bytes read/written from start of file */
 285    png_byte maximum_pixel_depth;
 286                               /* pixel depth used for the row buffers */
 287    png_byte transformed_pixel_depth;
 288                               /* pixel depth after read/write transforms */
 289 #if ZLIB_VERNUM >= 0x1240
 290    png_byte zstream_start;    /* at start of an input zlib stream */
 291 #endif /* Zlib >= 1.2.4 */
 292 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
 293    png_uint_16 filler;           /* filler bytes for pixel expansion */
 294 #endif
 295 
 296 #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
 297    defined(PNG_READ_ALPHA_MODE_SUPPORTED)
 298    png_byte background_gamma_type;
 299    png_fixed_point background_gamma;
 300    png_color_16 background;   /* background color in screen gamma space */
 301 #ifdef PNG_READ_GAMMA_SUPPORTED
 302    png_color_16 background_1; /* background normalized to gamma 1.0 */
 303 #endif
 304 #endif /* bKGD */
 305 
 306 #ifdef PNG_WRITE_FLUSH_SUPPORTED
 307    png_flush_ptr output_flush_fn; /* Function for flushing output */
 308    png_uint_32 flush_dist;    /* how many rows apart to flush, 0 - no flush */
 309    png_uint_32 flush_rows;    /* number of rows written since last flush */
 310 #endif
 311 
 312 #ifdef PNG_READ_GAMMA_SUPPORTED
 313    int gamma_shift;      /* number of "insignificant" bits in 16-bit gamma */
 314    png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */
 315 
 316    png_bytep gamma_table;     /* gamma table for 8-bit depth files */
 317    png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
 318 #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
 319    defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \
 320    defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
 321    png_bytep gamma_from_1;    /* converts from 1.0 to screen */
 322    png_bytep gamma_to_1;      /* converts from file to 1.0 */
 323    png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
 324    png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
 325 #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
 326 #endif
 327 
 328 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
 329    png_color_8 sig_bit;       /* significant bits in each available channel */
 330 #endif
 331 
 332 #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
 333    png_color_8 shift;         /* shift for significant bit transformation */
 334 #endif
 335 
 336 #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
 337  || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
 338    png_bytep trans_alpha;           /* alpha values for paletted files */
 339    png_color_16 trans_color;  /* transparent color for non-paletted files */
 340 #endif
 341 
 342    png_read_status_ptr read_row_fn;   /* called after each row is decoded */
 343    png_write_status_ptr write_row_fn; /* called after each row is encoded */
 344 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
 345    png_progressive_info_ptr info_fn; /* called after header data fully read */
 346    png_progressive_row_ptr row_fn;   /* called after a prog. row is decoded */
 347    png_progressive_end_ptr end_fn;   /* called after image is complete */
 348    png_bytep save_buffer_ptr;        /* current location in save_buffer */
 349    png_bytep save_buffer;            /* buffer for previously read data */
 350    png_bytep current_buffer_ptr;     /* current location in current_buffer */
 351    png_bytep current_buffer;         /* buffer for recently used data */
 352    png_uint_32 push_length;          /* size of current input chunk */
 353    png_uint_32 skip_length;          /* bytes to skip in input data */
 354    size_t save_buffer_size;          /* amount of data now in save_buffer */
 355    size_t save_buffer_max;           /* total size of save_buffer */
 356    size_t buffer_size;               /* total amount of available input data */
 357    size_t current_buffer_size;       /* amount of data now in current_buffer */
 358    int process_mode;                 /* what push library is currently doing */
 359    int cur_palette;                  /* current push library palette index */
 360 
 361 #endif /* PROGRESSIVE_READ */
 362 
 363 #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
 364 /* For the Borland special 64K segment handler */
 365    png_bytepp offset_table_ptr;
 366    png_bytep offset_table;
 367    png_uint_16 offset_table_number;
 368    png_uint_16 offset_table_count;
 369    png_uint_16 offset_table_count_free;
 370 #endif
 371 
 372 #ifdef PNG_READ_QUANTIZE_SUPPORTED
 373    png_bytep palette_lookup; /* lookup table for quantizing */
 374    png_bytep quantize_index; /* index translation for palette files */
 375 #endif
 376 
 377 /* Options */
 378 #ifdef PNG_SET_OPTION_SUPPORTED
 379    png_uint_32 options;           /* On/off state (up to 16 options) */
 380 #endif
 381 
 382 #if PNG_LIBPNG_VER < 10700
 383 /* To do: remove this from libpng-1.7 */
 384 #ifdef PNG_TIME_RFC1123_SUPPORTED
 385    char time_buffer[29]; /* String to hold RFC 1123 time text */
 386 #endif
 387 #endif
 388 
 389 /* New members added in libpng-1.0.6 */
 390 
 391    png_uint_32 free_me;    /* flags items libpng is responsible for freeing */
 392 
 393 #ifdef PNG_USER_CHUNKS_SUPPORTED
 394    png_voidp user_chunk_ptr;
 395 #ifdef PNG_READ_USER_CHUNKS_SUPPORTED
 396    png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
 397 #endif
 398 #endif
 399 
 400 #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
 401    int          unknown_default; /* As PNG_HANDLE_* */
 402    unsigned int num_chunk_list;  /* Number of entries in the list */
 403    png_bytep    chunk_list;      /* List of png_byte[5]; the textual chunk name
 404                                   * followed by a PNG_HANDLE_* byte */
 405 #endif
 406 
 407 /* New members added in libpng-1.0.3 */
 408 #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
 409    png_byte rgb_to_gray_status;
 410    /* Added in libpng 1.5.5 to record setting of coefficients: */
 411    png_byte rgb_to_gray_coefficients_set;
 412    /* These were changed from png_byte in libpng-1.0.6 */
 413    png_uint_16 rgb_to_gray_red_coeff;
 414    png_uint_16 rgb_to_gray_green_coeff;
 415    /* deleted in 1.5.5: rgb_to_gray_blue_coeff; */
 416 #endif
 417 
 418 /* New member added in libpng-1.6.36 */
 419 #if defined(PNG_READ_EXPAND_SUPPORTED) && \
 420     defined(PNG_ARM_NEON_IMPLEMENTATION)
 421    png_bytep riffled_palette; /* buffer for accelerated palette expansion */
 422 #endif
 423 
 424 /* New member added in libpng-1.0.4 (renamed in 1.0.9) */
 425 #if defined(PNG_MNG_FEATURES_SUPPORTED)
 426 /* Changed from png_byte to png_uint_32 at version 1.2.0 */
 427    png_uint_32 mng_features_permitted;
 428 #endif
 429 
 430 /* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */
 431 #ifdef PNG_MNG_FEATURES_SUPPORTED
 432    png_byte filter_type;
 433 #endif
 434 
 435 /* New members added in libpng-1.2.0 */
 436 
 437 /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */
 438 #ifdef PNG_USER_MEM_SUPPORTED
 439    png_voidp mem_ptr;             /* user supplied struct for mem functions */
 440    png_malloc_ptr malloc_fn;      /* function for allocating memory */
 441    png_free_ptr free_fn;          /* function for freeing memory */
 442 #endif
 443 
 444 /* New member added in libpng-1.0.13 and 1.2.0 */
 445    png_bytep big_row_buf;         /* buffer to save current (unfiltered) row */
 446 
 447 #ifdef PNG_READ_QUANTIZE_SUPPORTED
 448 /* The following three members were added at version 1.0.14 and 1.2.4 */
 449    png_bytep quantize_sort;          /* working sort array */
 450    png_bytep index_to_palette;       /* where the original index currently is
 451                                         in the palette */
 452    png_bytep palette_to_index;       /* which original index points to this
 453                                          palette color */
 454 #endif
 455 
 456 /* New members added in libpng-1.0.16 and 1.2.6 */
 457    png_byte compression_type;
 458 
 459 #ifdef PNG_USER_LIMITS_SUPPORTED
 460    png_uint_32 user_width_max;
 461    png_uint_32 user_height_max;
 462 
 463    /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown
 464     * chunks that can be stored (0 means unlimited).
 465     */
 466    png_uint_32 user_chunk_cache_max;
 467 
 468    /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk
 469     * can occupy when decompressed.  0 means unlimited.
 470     */
 471    png_alloc_size_t user_chunk_malloc_max;
 472 #endif
 473 
 474 /* New member added in libpng-1.0.25 and 1.2.17 */
 475 #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
 476    /* Temporary storage for unknown chunk that the library doesn't recognize,
 477     * used while reading the chunk.
 478     */
 479    png_unknown_chunk unknown_chunk;
 480 #endif
 481 
 482 /* New member added in libpng-1.2.26 */
 483    size_t old_big_row_buf_size;
 484 
 485 #ifdef PNG_READ_SUPPORTED
 486 /* New member added in libpng-1.2.30 */
 487   png_bytep        read_buffer;      /* buffer for reading chunk data */
 488   png_alloc_size_t read_buffer_size; /* current size of the buffer */
 489 #endif
 490 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 491   uInt             IDAT_read_size;   /* limit on read buffer size for IDAT */
 492 #endif
 493 
 494 #ifdef PNG_IO_STATE_SUPPORTED
 495 /* New member added in libpng-1.4.0 */
 496    png_uint_32 io_state;
 497 #endif
 498 
 499 /* New member added in libpng-1.5.6 */
 500    png_bytep big_prev_row;
 501 
 502 /* New member added in libpng-1.5.7 */
 503    void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info,
 504       png_bytep row, png_const_bytep prev_row);
 505 
 506 #ifdef PNG_READ_SUPPORTED
 507 #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
 508    png_colorspace   colorspace;
 509 #endif
 510 #endif
 511 };
 512 #endif /* PNGSTRUCT_H */