-#ifdef PNG_USE_LOCAL_ARRAYS
- PNG_IHDR;
- PNG_IDAT;
- PNG_IEND;
- PNG_PLTE;
-#if defined(PNG_READ_bKGD_SUPPORTED)
- PNG_bKGD;
-#endif
-#if defined(PNG_READ_cHRM_SUPPORTED)
- PNG_cHRM;
-#endif
-#if defined(PNG_READ_gAMA_SUPPORTED)
- PNG_gAMA;
-#endif
-#if defined(PNG_READ_hIST_SUPPORTED)
- PNG_hIST;
-#endif
-#if defined(PNG_READ_iCCP_SUPPORTED)
- PNG_iCCP;
-#endif
-#if defined(PNG_READ_iTXt_SUPPORTED)
- PNG_iTXt;
-#endif
-#if defined(PNG_READ_oFFs_SUPPORTED)
- PNG_oFFs;
-#endif
-#if defined(PNG_READ_pCAL_SUPPORTED)
- PNG_pCAL;
-#endif
-#if defined(PNG_READ_pHYs_SUPPORTED)
- PNG_pHYs;
-#endif
-#if defined(PNG_READ_sBIT_SUPPORTED)
- PNG_sBIT;
-#endif
-#if defined(PNG_READ_sCAL_SUPPORTED)
- PNG_sCAL;
-#endif
-#if defined(PNG_READ_sPLT_SUPPORTED)
- PNG_sPLT;
-#endif
-#if defined(PNG_READ_sRGB_SUPPORTED)
- PNG_sRGB;
-#endif
-#if defined(PNG_READ_tEXt_SUPPORTED)
- PNG_tEXt;
-#endif
-#if defined(PNG_READ_tIME_SUPPORTED)
- PNG_tIME;
-#endif
-#if defined(PNG_READ_tRNS_SUPPORTED)
- PNG_tRNS;
-#endif
-#if defined(PNG_READ_zTXt_SUPPORTED)
- PNG_zTXt;
-#endif
-#endif /* PNG_GLOBAL_ARRAYS */
- png_byte chunk_length[4];
- png_uint_32 length;
-
- png_read_data(png_ptr, chunk_length, 4);
- length = png_get_uint_32(chunk_length);
-
- png_reset_crc(png_ptr);
- png_crc_read(png_ptr, png_ptr->chunk_name, 4);
-
- png_debug2(0, "Reading %s chunk, length=%lu.\n", png_ptr->chunk_name,
- length);
-
- if (length > PNG_MAX_UINT)
- png_error(png_ptr, "Invalid chunk length.");