19#ifdef PNG_READ_SUPPORTED
27 png_error(
png_ptr,
"PNG unsigned integer out of range");
32#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_READ_cHRM_SUPPORTED)
38#define PNG_FIXED_ERROR (-1)
50 png_warning(
png_ptr,
"PNG fixed point integer out of range");
52 return PNG_FIXED_ERROR;
56#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED
88 if ((uval & 0x80000000) == 0)
89 return (png_int_32)uval;
91 uval = (uval ^ 0xffffffff) + 1;
92 if ((uval & 0x80000000) == 0)
93 return -(png_int_32)uval;
111 ((
unsigned int)(*
buf) << 8) +
112 ((
unsigned int)(*(
buf + 1)));
114 return (png_uint_16)
val;
123 size_t num_checked, num_to_check;
129 num_checked =
png_ptr->sig_bytes;
130 num_to_check = 8 - num_checked;
132#ifdef PNG_IO_STATE_SUPPORTED
137 png_read_data(
png_ptr, &(
info_ptr->signature[num_checked]), num_to_check);
140 if (png_sig_cmp(
info_ptr->signature, num_checked, num_to_check) != 0)
142 if (num_checked < 4 &&
143 png_sig_cmp(
info_ptr->signature, num_checked, num_to_check - 4))
144 png_error(
png_ptr,
"Not a PNG file");
146 png_error(
png_ptr,
"PNG file corrupted by ASCII conversion");
161#ifdef PNG_IO_STATE_SUPPORTED
174 png_debug2(0,
"Reading %lx chunk, length = %lu",
187#ifdef PNG_IO_STATE_SUPPORTED
221 len = (
sizeof tmpbuf);
229 if (png_crc_error(
png_ptr) != 0)
235 png_chunk_warning(
png_ptr,
"CRC error");
239 png_chunk_error(
png_ptr,
"CRC error");
253 png_byte crc_bytes[4];
270#ifdef PNG_IO_STATE_SUPPORTED
275 png_read_data(
png_ptr, crc_bytes, 4);
280 return ((
int)(crc !=
png_ptr->crc));
287#if defined(PNG_READ_iCCP_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) ||\
288 defined(PNG_READ_pCAL_SUPPORTED) || defined(PNG_READ_sCAL_SUPPORTED) ||\
289 defined(PNG_READ_sPLT_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) ||\
290 defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_SEQUENTIAL_READ_SUPPORTED)
318 png_ptr->read_buffer_size = new_size;
324 png_chunk_warning(
png_ptr,
"insufficient memory to read chunk");
327 png_chunk_error(
png_ptr,
"insufficient memory to read chunk");
352 (
void)png_safecat(
msg, (
sizeof msg), 4,
" using zstream");
376#if ZLIB_VERNUM >= 0x1240
379# if defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_MAXIMUM_INFLATE_WINDOW)
401 png_ptr->zstream.avail_out = 0;
405#if ZLIB_VERNUM >= 0x1240
414#if ZLIB_VERNUM >= 0x1240
424#if ZLIB_VERNUM >= 0x1290 && \
425 defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
445#if ZLIB_VERNUM >= 0x1240
457 if ((*
png_ptr->zstream.next_in >> 4) > 7)
459 png_ptr->zstream.msg =
"invalid window size (libpng)";
470#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED
471#if defined(PNG_READ_zTXt_SUPPORTED) || defined (PNG_READ_iTXt_SUPPORTED)
506 png_ptr->zstream.avail_out = 0;
512 png_ptr->zstream.next_out = output;
527 avail_in +=
png_ptr->zstream.avail_in;
531 if (avail_in <
avail)
538 avail_out +=
png_ptr->zstream.avail_out;
547 png_ptr->zstream.next_out = local_buffer;
548 if ((
sizeof local_buffer) <
avail)
549 avail = (
sizeof local_buffer);
552 if (avail_out <
avail)
573 avail_in +=
png_ptr->zstream.avail_in;
574 avail_out +=
png_ptr->zstream.avail_out;
580 *output_size_ptr -= avail_out;
583 *input_size_ptr -= avail_in;
623# ifdef PNG_SET_USER_LIMITS_SUPPORTED
624 if (
png_ptr->user_chunk_malloc_max > 0 &&
627# elif PNG_USER_CHUNK_MALLOC_MAX > 0
638 if (
limit < *newlength)
649 png_ptr->read_buffer + prefix_size, &lzsize,
679 png_ptr->read_buffer + prefix_size, &lzsize,
680 text + prefix_size, newlength);
684 if (new_size == *newlength)
687 text[prefix_size + *newlength] = 0;
725 chunklength - prefix_size != lzsize)
726 png_chunk_benign_error(
png_ptr,
"extra compressed data");
768#ifdef PNG_READ_iCCP_SUPPORTED
782 png_ptr->zstream.next_out = next_out;
783 png_ptr->zstream.avail_out = 0;
787 if (
png_ptr->zstream.avail_in == 0)
789 if (read_size > *chunk_bytes)
790 read_size = (
uInt)*chunk_bytes;
791 *chunk_bytes -= read_size;
794 png_crc_read(
png_ptr, read_buffer, read_size);
796 png_ptr->zstream.next_in = read_buffer;
797 png_ptr->zstream.avail_in = read_size;
800 if (
png_ptr->zstream.avail_out == 0)
820 png_ptr->zstream.avail_out = 0;
842 int bit_depth, color_type, compression_type, filter_type;
848 png_chunk_error(
png_ptr,
"out of place");
852 png_chunk_error(
png_ptr,
"invalid");
863 compression_type =
buf[10];
864 filter_type =
buf[11];
865 interlace_type =
buf[12];
870 png_ptr->bit_depth = (png_byte)bit_depth;
871 png_ptr->interlaced = (png_byte)interlace_type;
872 png_ptr->color_type = (png_byte)color_type;
873#ifdef PNG_MNG_FEATURES_SUPPORTED
874 png_ptr->filter_type = (png_byte)filter_type;
876 png_ptr->compression_type = (png_byte)compression_type;
907 color_type, interlace_type, compression_type, filter_type);
915 int max_palette_length,
num,
i;
916#ifdef PNG_POINTER_INDEXING_SUPPORTED
923 png_chunk_error(
png_ptr,
"missing IHDR");
931 png_chunk_error(
png_ptr,
"duplicate");
939 png_chunk_benign_error(
png_ptr,
"out of place");
948 png_chunk_benign_error(
png_ptr,
"ignored in grayscale PNG");
952#ifndef PNG_READ_OPT_PLTE_SUPPORTED
965 png_chunk_benign_error(
png_ptr,
"invalid");
968 png_chunk_error(
png_ptr,
"invalid");
982 max_palette_length = (1 <<
png_ptr->bit_depth);
986 if (
num > max_palette_length)
987 num = max_palette_length;
989#ifdef PNG_POINTER_INDEXING_SUPPORTED
1000 for (
i = 0;
i <
num;
i++)
1017#ifndef PNG_READ_OPT_PLTE_SUPPORTED
1024#ifndef PNG_READ_OPT_PLTE_SUPPORTED
1025 else if (png_crc_error(
png_ptr) != 0)
1042 png_chunk_error(
png_ptr,
"CRC error");
1047 png_chunk_warning(
png_ptr,
"CRC error");
1070#ifdef PNG_READ_tRNS_SUPPORTED
1083 png_chunk_benign_error(
png_ptr,
"tRNS must be after");
1087#ifdef PNG_READ_hIST_SUPPORTED
1089 png_chunk_benign_error(
png_ptr,
"hIST must be after");
1092#ifdef PNG_READ_bKGD_SUPPORTED
1094 png_chunk_benign_error(
png_ptr,
"bKGD must be after");
1105 png_chunk_error(
png_ptr,
"out of place");
1112 png_chunk_benign_error(
png_ptr,
"invalid");
1117#ifdef PNG_READ_gAMA_SUPPORTED
1127 png_chunk_error(
png_ptr,
"missing IHDR");
1132 png_chunk_benign_error(
png_ptr,
"out of place");
1139 png_chunk_benign_error(
png_ptr,
"invalid");
1145 if (png_crc_finish(
png_ptr, 0) != 0)
1148 igamma = png_get_fixed_point(
NULL,
buf);
1155#ifdef PNG_READ_sBIT_SUPPORTED
1159 unsigned int truelen,
i;
1160 png_byte sample_depth;
1166 png_chunk_error(
png_ptr,
"missing IHDR");
1171 png_chunk_benign_error(
png_ptr,
"out of place");
1178 png_chunk_benign_error(
png_ptr,
"duplicate");
1191 sample_depth =
png_ptr->bit_depth;
1196 png_chunk_benign_error(
png_ptr,
"invalid");
1204 if (png_crc_finish(
png_ptr, 0) != 0)
1207 for (
i=0;
i<truelen; ++
i)
1209 if (
buf[
i] == 0 ||
buf[
i] > sample_depth)
1211 png_chunk_benign_error(
png_ptr,
"invalid");
1237#ifdef PNG_READ_cHRM_SUPPORTED
1247 png_chunk_error(
png_ptr,
"missing IHDR");
1252 png_chunk_benign_error(
png_ptr,
"out of place");
1259 png_chunk_benign_error(
png_ptr,
"invalid");
1265 if (png_crc_finish(
png_ptr, 0) != 0)
1268 xy.whitex = png_get_fixed_point(
NULL,
buf);
1269 xy.whitey = png_get_fixed_point(
NULL,
buf + 4);
1270 xy.redx = png_get_fixed_point(
NULL,
buf + 8);
1271 xy.redy = png_get_fixed_point(
NULL,
buf + 12);
1272 xy.greenx = png_get_fixed_point(
NULL,
buf + 16);
1273 xy.greeny = png_get_fixed_point(
NULL,
buf + 20);
1274 xy.bluex = png_get_fixed_point(
NULL,
buf + 24);
1275 xy.bluey = png_get_fixed_point(
NULL,
buf + 28);
1277 if (xy.whitex == PNG_FIXED_ERROR ||
1278 xy.whitey == PNG_FIXED_ERROR ||
1279 xy.redx == PNG_FIXED_ERROR ||
1280 xy.redy == PNG_FIXED_ERROR ||
1281 xy.greenx == PNG_FIXED_ERROR ||
1282 xy.greeny == PNG_FIXED_ERROR ||
1283 xy.bluex == PNG_FIXED_ERROR ||
1284 xy.bluey == PNG_FIXED_ERROR)
1286 png_chunk_benign_error(
png_ptr,
"invalid values");
1291 if ((
png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0)
1294 if ((
png_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0)
1296 png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
1298 png_chunk_benign_error(
png_ptr,
"duplicate");
1302 png_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
1309#ifdef PNG_READ_sRGB_SUPPORTED
1318 png_chunk_error(
png_ptr,
"missing IHDR");
1323 png_chunk_benign_error(
png_ptr,
"out of place");
1330 png_chunk_benign_error(
png_ptr,
"invalid");
1334 png_crc_read(
png_ptr, &intent, 1);
1336 if (png_crc_finish(
png_ptr, 0) != 0)
1340 if ((
png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0)
1346 if ((
png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_INTENT) != 0)
1348 png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
1350 png_chunk_benign_error(
png_ptr,
"too many profiles");
1359#ifdef PNG_READ_iCCP_SUPPORTED
1370 png_chunk_error(
png_ptr,
"missing IHDR");
1375 png_chunk_benign_error(
png_ptr,
"out of place");
1392 png_chunk_benign_error(
png_ptr,
"too short");
1397 if ((
png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0)
1406 if ((
png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_INTENT) == 0)
1408 uInt read_length, keyword_length;
1415 if (read_length >
length)
1427 png_chunk_benign_error(
png_ptr,
"too short");
1432 while (keyword_length < 80 && keyword_length < read_length &&
1437 if (keyword_length >= 1 && keyword_length <= 79)
1442 if (keyword_length+1 < read_length &&
1445 read_length -= keyword_length+2;
1449 Byte profile_header[132]={0};
1454 png_ptr->zstream.avail_in = read_length;
1456 (
sizeof local_buffer), &
length, profile_header, &
size,
1466 keyword, profile_length) != 0)
1472 keyword, profile_length, profile_header,
1488 (
sizeof profile_header));
1490 size = 12 * tag_count;
1493 (
sizeof local_buffer), &
length,
1501 if (png_icc_check_tag_table(
png_ptr,
1508 size = profile_length - (
sizeof profile_header)
1512 (
sizeof local_buffer), &
length,
1513 profile + (
sizeof profile_header) +
1514 12 * tag_count, &
size, 1);
1518 errmsg =
"extra compressed data";
1529 "extra compressed data");
1535# if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0
1566 PNG_COLORSPACE_INVALID;
1567 errmsg =
"out of memory";
1595 errmsg =
"out of memory";
1616 errmsg =
"bad compression method";
1624 errmsg =
"too many profiles";
1630 png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
1637#ifdef PNG_READ_sPLT_SUPPORTED
1653#ifdef PNG_USER_LIMITS_SUPPORTED
1654 if (
png_ptr->user_chunk_cache_max != 0)
1656 if (
png_ptr->user_chunk_cache_max == 1)
1662 if (--
png_ptr->user_chunk_cache_max == 1)
1664 png_warning(
png_ptr,
"No space in chunk cache for sPLT");
1672 png_chunk_error(
png_ptr,
"missing IHDR");
1677 png_chunk_benign_error(
png_ptr,
"out of place");
1681#ifdef PNG_MAX_MALLOC_64K
1685 png_chunk_benign_error(
png_ptr,
"too large to fit in memory");
1694 png_chunk_benign_error(
png_ptr,
"out of memory");
1710 for (entry_start =
buffer; *entry_start; entry_start++)
1716 if (length < 2U || entry_start >
buffer + (
length - 2U))
1718 png_warning(
png_ptr,
"malformed sPLT chunk");
1722 new_palette.
depth = *entry_start++;
1723 entry_size = (new_palette.
depth == 8 ? 6 : 10);
1730 if ((data_length % (
unsigned int)entry_size) != 0)
1732 png_warning(
png_ptr,
"sPLT chunk has bad length");
1736 dl = (
png_uint_32)(data_length / (
unsigned int)entry_size);
1741 png_warning(
png_ptr,
"sPLT chunk too long");
1745 new_palette.
nentries = (png_int_32)(data_length / (
unsigned int)entry_size);
1752 png_warning(
png_ptr,
"sPLT chunk requires too much memory");
1756#ifdef PNG_POINTER_INDEXING_SUPPORTED
1761 if (new_palette.
depth == 8)
1763 pp->
red = *entry_start++;
1764 pp->
green = *entry_start++;
1765 pp->
blue = *entry_start++;
1766 pp->
alpha = *entry_start++;
1785 if (new_palette.
depth == 8)
1787 pp[
i].
red = *entry_start++;
1788 pp[
i].
green = *entry_start++;
1789 pp[
i].
blue = *entry_start++;
1790 pp[
i].
alpha = *entry_start++;
1814#ifdef PNG_READ_tRNS_SUPPORTED
1823 png_chunk_error(
png_ptr,
"missing IHDR");
1828 png_chunk_benign_error(
png_ptr,
"out of place");
1835 png_chunk_benign_error(
png_ptr,
"duplicate");
1846 png_chunk_benign_error(
png_ptr,
"invalid");
1862 png_chunk_benign_error(
png_ptr,
"invalid");
1879 png_chunk_benign_error(
png_ptr,
"out of place");
1888 png_chunk_benign_error(
png_ptr,
"invalid");
1899 png_chunk_benign_error(
png_ptr,
"invalid with alpha channel");
1903 if (png_crc_finish(
png_ptr, 0) != 0)
1918#ifdef PNG_READ_bKGD_SUPPORTED
1922 unsigned int truelen;
1929 png_chunk_error(
png_ptr,
"missing IHDR");
1936 png_chunk_benign_error(
png_ptr,
"out of place");
1943 png_chunk_benign_error(
png_ptr,
"duplicate");
1959 png_chunk_benign_error(
png_ptr,
"invalid");
1965 if (png_crc_finish(
png_ptr, 0) != 0)
1981 png_chunk_benign_error(
png_ptr,
"invalid index");
1991 background.
red = background.
green = background.
blue = 0;
1993 background.
gray = 0;
2000 if (
buf[0] != 0 ||
buf[1] >= (
unsigned int)(1 <<
png_ptr->bit_depth))
2002 png_chunk_benign_error(
png_ptr,
"invalid gray level");
2007 background.
index = 0;
2018 if (
buf[0] != 0 ||
buf[2] != 0 ||
buf[4] != 0)
2020 png_chunk_benign_error(
png_ptr,
"invalid color");
2025 background.
index = 0;
2029 background.
gray = 0;
2036#ifdef PNG_READ_eXIf_SUPPORTED
2045 png_chunk_error(
png_ptr,
"missing IHDR");
2050 png_chunk_benign_error(
png_ptr,
"too short");
2057 png_chunk_benign_error(
png_ptr,
"duplicate");
2069 png_chunk_benign_error(
png_ptr,
"out of memory");
2080 if ((
buf[0] !=
'M' &&
buf[0] !=
'I') ||
2084 png_chunk_benign_error(
png_ptr,
"incorrect byte-order specifier");
2092 if (png_crc_finish(
png_ptr, 0) == 0)
2100#ifdef PNG_READ_hIST_SUPPORTED
2104 unsigned int num,
i;
2110 png_chunk_error(
png_ptr,
"missing IHDR");
2116 png_chunk_benign_error(
png_ptr,
"out of place");
2123 png_chunk_benign_error(
png_ptr,
"duplicate");
2134 png_chunk_benign_error(
png_ptr,
"invalid");
2138 for (
i = 0;
i <
num;
i++)
2146 if (png_crc_finish(
png_ptr, 0) != 0)
2153#ifdef PNG_READ_pHYs_SUPPORTED
2164 png_chunk_error(
png_ptr,
"missing IHDR");
2169 png_chunk_benign_error(
png_ptr,
"out of place");
2176 png_chunk_benign_error(
png_ptr,
"duplicate");
2183 png_chunk_benign_error(
png_ptr,
"invalid");
2189 if (png_crc_finish(
png_ptr, 0) != 0)
2199#ifdef PNG_READ_oFFs_SUPPORTED
2204 png_int_32 offset_x, offset_y;
2210 png_chunk_error(
png_ptr,
"missing IHDR");
2215 png_chunk_benign_error(
png_ptr,
"out of place");
2222 png_chunk_benign_error(
png_ptr,
"duplicate");
2229 png_chunk_benign_error(
png_ptr,
"invalid");
2235 if (png_crc_finish(
png_ptr, 0) != 0)
2245#ifdef PNG_READ_pCAL_SUPPORTED
2251 png_byte
type, nparams;
2259 png_chunk_error(
png_ptr,
"missing IHDR");
2264 png_chunk_benign_error(
png_ptr,
"out of place");
2271 png_chunk_benign_error(
png_ptr,
"duplicate");
2275 png_debug1(2,
"Allocating and reading pCAL chunk data (%u bytes)",
2283 png_chunk_benign_error(
png_ptr,
"out of memory");
2289 if (png_crc_finish(
png_ptr, 0) != 0)
2294 png_debug(3,
"Finding end of pCAL purpose string");
2303 if (endptr -
buf <= 12)
2305 png_chunk_benign_error(
png_ptr,
"invalid");
2309 png_debug(3,
"Reading pCAL X0, X1, type, nparams, and units");
2316 png_debug(3,
"Checking pCAL equation type and number of parameters");
2325 png_chunk_benign_error(
png_ptr,
"invalid parameter count");
2331 png_chunk_benign_error(
png_ptr,
"unrecognized equation type");
2337 png_debug(3,
"Allocating pCAL parameters array");
2344 png_chunk_benign_error(
png_ptr,
"out of memory");
2349 for (
i = 0;
i < nparams;
i++)
2362 png_chunk_benign_error(
png_ptr,
"invalid data");
2374#ifdef PNG_READ_sCAL_SUPPORTED
2386 png_chunk_error(
png_ptr,
"missing IHDR");
2391 png_chunk_benign_error(
png_ptr,
"out of place");
2398 png_chunk_benign_error(
png_ptr,
"duplicate");
2406 png_chunk_benign_error(
png_ptr,
"invalid");
2410 png_debug1(2,
"Allocating and reading sCAL chunk data (%u bytes)",
2417 png_chunk_benign_error(
png_ptr,
"out of memory");
2425 if (png_crc_finish(
png_ptr, 0) != 0)
2431 png_chunk_benign_error(
png_ptr,
"invalid unit");
2443 png_chunk_benign_error(
png_ptr,
"bad width format");
2445 else if (PNG_FP_IS_POSITIVE(
state) == 0)
2446 png_chunk_benign_error(
png_ptr,
"non-positive width");
2455 png_chunk_benign_error(
png_ptr,
"bad height format");
2457 else if (PNG_FP_IS_POSITIVE(
state) == 0)
2458 png_chunk_benign_error(
png_ptr,
"non-positive height");
2468#ifdef PNG_READ_tIME_SUPPORTED
2478 png_chunk_error(
png_ptr,
"missing IHDR");
2483 png_chunk_benign_error(
png_ptr,
"duplicate");
2493 png_chunk_benign_error(
png_ptr,
"invalid");
2499 if (png_crc_finish(
png_ptr, 0) != 0)
2513#ifdef PNG_READ_tEXt_SUPPORTED
2526#ifdef PNG_USER_LIMITS_SUPPORTED
2527 if (
png_ptr->user_chunk_cache_max != 0)
2529 if (
png_ptr->user_chunk_cache_max == 1)
2535 if (--
png_ptr->user_chunk_cache_max == 1)
2538 png_chunk_benign_error(
png_ptr,
"no space in chunk cache");
2545 png_chunk_error(
png_ptr,
"missing IHDR");
2550#ifdef PNG_MAX_MALLOC_64K
2554 png_chunk_benign_error(
png_ptr,
"too large to fit in memory");
2563 png_chunk_benign_error(
png_ptr,
"out of memory");
2590 png_warning(
png_ptr,
"Insufficient memory to process text chunk");
2594#ifdef PNG_READ_zTXt_SUPPORTED
2605#ifdef PNG_USER_LIMITS_SUPPORTED
2606 if (
png_ptr->user_chunk_cache_max != 0)
2608 if (
png_ptr->user_chunk_cache_max == 1)
2614 if (--
png_ptr->user_chunk_cache_max == 1)
2617 png_chunk_benign_error(
png_ptr,
"no space in chunk cache");
2624 png_chunk_error(
png_ptr,
"missing IHDR");
2637 png_chunk_benign_error(
png_ptr,
"out of memory");
2643 if (png_crc_finish(
png_ptr, 0) != 0)
2647 for (keyword_length = 0;
2648 keyword_length <
length &&
buffer[keyword_length] != 0;
2652 if (keyword_length > 79 || keyword_length < 1)
2659 else if (keyword_length + 3 >
length)
2663 errmsg =
"unknown compression type";
2679 errmsg=
"Read failure in png_handle_zTXt";
2687 buffer[uncompressed_length+(keyword_length+2)] = 0;
2692 text.text_length = uncompressed_length;
2693 text.itxt_length = 0;
2698 errmsg =
"insufficient memory";
2711#ifdef PNG_READ_iTXt_SUPPORTED
2722#ifdef PNG_USER_LIMITS_SUPPORTED
2723 if (
png_ptr->user_chunk_cache_max != 0)
2725 if (
png_ptr->user_chunk_cache_max == 1)
2731 if (--
png_ptr->user_chunk_cache_max == 1)
2734 png_chunk_benign_error(
png_ptr,
"no space in chunk cache");
2741 png_chunk_error(
png_ptr,
"missing IHDR");
2751 png_chunk_benign_error(
png_ptr,
"out of memory");
2757 if (png_crc_finish(
png_ptr, 0) != 0)
2761 for (prefix_length=0;
2767 if (prefix_length > 79 || prefix_length < 1)
2774 else if (prefix_length + 5 >
length)
2777 else if (
buffer[prefix_length+1] == 0 ||
2778 (
buffer[prefix_length+1] == 1 &&
2781 int compressed =
buffer[prefix_length+1] != 0;
2782 png_uint_32 language_offset, translated_keyword_offset;
2787 language_offset = prefix_length;
2789 for (; prefix_length <
length &&
buffer[prefix_length] != 0;
2794 translated_keyword_offset = ++prefix_length;
2796 for (; prefix_length <
length &&
buffer[prefix_length] != 0;
2807 if (compressed == 0 && prefix_length <=
length)
2808 uncompressed_length =
length - prefix_length;
2810 else if (compressed != 0 && prefix_length <
length)
2833 buffer[uncompressed_length+prefix_length] = 0;
2835 if (compressed == 0)
2845 text.text_length = 0;
2846 text.itxt_length = uncompressed_length;
2849 errmsg =
"insufficient memory";
2854 errmsg =
"bad compression info";
2861#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
2874# ifdef PNG_SET_USER_LIMITS_SUPPORTED
2875 if (
png_ptr->user_chunk_malloc_max > 0 &&
2879# elif PNG_USER_CHUNK_MALLOC_MAX > 0
2907 png_chunk_benign_error(
png_ptr,
"unknown chunk exceeds memory limits");
2930#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
2942# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
2943# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
2952# ifdef PNG_READ_USER_CHUNKS_SUPPORTED
2974 png_chunk_error(
png_ptr,
"error in user chunk");
2991# ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
2994 png_chunk_warning(
png_ptr,
"Saving unknown chunk:");
2996 "forcing save of an unhandled chunk;"
2997 " please call png_set_keep_unknown_chunks");
3021# ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
3029 keep =
png_ptr->unknown_default;
3043# ifndef PNG_READ_USER_CHUNKS_SUPPORTED
3044# error no method to support READ_UNKNOWN_CHUNKS
3061# ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
3069# ifdef PNG_USER_LIMITS_SUPPORTED
3070 switch (
png_ptr->user_chunk_cache_max)
3073 png_ptr->user_chunk_cache_max = 1;
3074 png_chunk_benign_error(
png_ptr,
"no space in chunk cache");
3083 --(
png_ptr->user_chunk_cache_max);
3093# ifdef PNG_USER_LIMITS_SUPPORTED
3119 png_chunk_error(
png_ptr,
"unhandled critical chunk");
3140 png_debug(1,
"in png_check_chunk_name");
3142 for (
i=1;
i<=4; ++
i)
3146 if (c < 65 || c > 122 || (
c > 90 &&
c < 97))
3147 png_chunk_error(
png_ptr,
"invalid chunk type");
3158# ifdef PNG_SET_USER_LIMITS_SUPPORTED
3159 if (
png_ptr->user_chunk_malloc_max > 0 &&
3162# elif PNG_USER_CHUNK_MALLOC_MAX > 0
3172 * (
png_ptr->bit_depth > 8? 2: 1)
3174 + (
png_ptr->interlaced? 6: 0);
3178 idat_limit =
png_ptr->height * row_factor;
3179 row_factor = row_factor > 32566? 32566 : row_factor;
3180 idat_limit += 6 + 5*(idat_limit/row_factor+1);
3189 png_benign_error(
png_ptr,
"chunk data is too large");
3203 unsigned int pixel_depth =
png_ptr->transformed_pixel_depth;
3208 png_byte end_byte = 0;
3209 unsigned int end_mask;
3216 if (pixel_depth == 0)
3217 png_error(
png_ptr,
"internal row logic error");
3225 png_error(
png_ptr,
"internal row size calculation error");
3229 png_error(
png_ptr,
"internal row width error");
3235 end_mask = (pixel_depth * row_width) & 7;
3239 end_ptr = dp +
PNG_ROWBYTES(pixel_depth, row_width) - 1;
3240 end_byte = *end_ptr;
3241# ifdef PNG_READ_PACKSWAP_SUPPORTED
3244 end_mask = (
unsigned int)(0xff << end_mask);
3248 end_mask = 0xff >> end_mask;
3258#ifdef PNG_READ_INTERLACING_SUPPORTED
3259 if (
png_ptr->interlaced != 0 &&
3271 if (pixel_depth < 8)
3310# if PNG_USE_COMPILE_TIME_MASKS
3311# define PNG_LSR(x,s) ((x)>>((s) & 0x1f))
3312# define PNG_LSL(x,s) ((x)<<((s) & 0x1f))
3314# define PNG_LSR(x,s) ((x)>>(s))
3315# define PNG_LSL(x,s) ((x)<<(s))
3317# define S_COPY(p,x) (((p)<4 ? PNG_LSR(0x80088822,(3-(p))*8+(7-(x))) :\
3318 PNG_LSR(0xaa55ff00,(7-(p))*8+(7-(x)))) & 1)
3319# define B_COPY(p,x) (((p)<4 ? PNG_LSR(0xff0fff33,(3-(p))*8+(7-(x))) :\
3320 PNG_LSR(0xff55ff00,(7-(p))*8+(7-(x)))) & 1)
3328# define PIXEL_MASK(p,x,d,s) \
3329 (PNG_LSL(((PNG_LSL(1U,(d)))-1),(((x)*(d))^((s)?8-(d):0))))
3333# define S_MASKx(p,x,d,s) (S_COPY(p,x)?PIXEL_MASK(p,x,d,s):0)
3334# define B_MASKx(p,x,d,s) (B_COPY(p,x)?PIXEL_MASK(p,x,d,s):0)
3340# define MASK_EXPAND(m,d) ((m)*((d)==1?0x01010101:((d)==2?0x00010001:1)))
3342# define S_MASK(p,d,s) MASK_EXPAND(S_MASKx(p,0,d,s) + S_MASKx(p,1,d,s) +\
3343 S_MASKx(p,2,d,s) + S_MASKx(p,3,d,s) + S_MASKx(p,4,d,s) +\
3344 S_MASKx(p,5,d,s) + S_MASKx(p,6,d,s) + S_MASKx(p,7,d,s), d)
3346# define B_MASK(p,d,s) MASK_EXPAND(B_MASKx(p,0,d,s) + B_MASKx(p,1,d,s) +\
3347 B_MASKx(p,2,d,s) + B_MASKx(p,3,d,s) + B_MASKx(p,4,d,s) +\
3348 B_MASKx(p,5,d,s) + B_MASKx(p,6,d,s) + B_MASKx(p,7,d,s), d)
3350#if PNG_USE_COMPILE_TIME_MASKS
3356# define S_MASKS(d,s) { S_MASK(0,d,s), S_MASK(1,d,s), S_MASK(2,d,s),\
3357 S_MASK(3,d,s), S_MASK(4,d,s), S_MASK(5,d,s) }
3359# define B_MASKS(d,s) { B_MASK(1,d,s), B_MASK(3,d,s), B_MASK(5,d,s) }
3361# define DEPTH_INDEX(d) ((d)==1?0:((d)==2?1:2))
3369 { S_MASKS(1,0), S_MASKS(2,0), S_MASKS(4,0) },
3371 { S_MASKS(1,1), S_MASKS(2,1), S_MASKS(4,1) }
3380 { B_MASKS(1,0), B_MASKS(2,0), B_MASKS(4,0) },
3382 { B_MASKS(1,1), B_MASKS(2,1), B_MASKS(4,1) }
3385# define MASK(pass,depth,display,png)\
3386 ((display)?display_mask[png][DEPTH_INDEX(depth)][pass>>1]:\
3387 row_mask[png][DEPTH_INDEX(depth)][pass])
3393# define MASK(pass,depth,display,png)\
3394 ((display)?B_MASK(pass,depth,png):S_MASK(pass,depth,png))
3405# ifdef PNG_READ_PACKSWAP_SUPPORTED
3422 mask = (
m >> 8) | (
m << 24);
3428 *dp = (png_byte)((*dp & ~
m) | (*
sp &
m));
3437 if (row_width <= pixels_per_byte)
3440 row_width -= pixels_per_byte;
3448 unsigned int bytes_to_copy, bytes_to_jump;
3451 if (pixel_depth & 7)
3452 png_error(
png_ptr,
"invalid user transform pixel depth");
3455 row_width *= pixel_depth;
3476 bytes_to_copy = (1<<((6-
pass)>>1)) * pixel_depth;
3479 if (bytes_to_copy > row_width)
3480 bytes_to_copy = (
unsigned int)row_width;
3484 bytes_to_copy = pixel_depth;
3497 switch (bytes_to_copy)
3504 if (row_width <= bytes_to_jump)
3507 dp += bytes_to_jump;
3508 sp += bytes_to_jump;
3509 row_width -= bytes_to_jump;
3518 dp[0] =
sp[0]; dp[1] =
sp[1];
3520 if (row_width <= bytes_to_jump)
3523 sp += bytes_to_jump;
3524 dp += bytes_to_jump;
3525 row_width -= bytes_to_jump;
3527 while (row_width > 1);
3539 dp[0] =
sp[0]; dp[1] =
sp[1]; dp[2] =
sp[2];
3541 if (row_width <= bytes_to_jump)
3544 sp += bytes_to_jump;
3545 dp += bytes_to_jump;
3546 row_width -= bytes_to_jump;
3550#if PNG_ALIGN_TYPE != PNG_ALIGN_NONE
3556 if (bytes_to_copy < 16 &&
3559 bytes_to_copy % (
sizeof (png_uint_16)) == 0 &&
3560 bytes_to_jump % (
sizeof (png_uint_16)) == 0)
3573 size_t skip = (bytes_to_jump-bytes_to_copy) /
3578 size_t c = bytes_to_copy;
3586 if (row_width <= bytes_to_jump)
3591 row_width -= bytes_to_jump;
3593 while (bytes_to_copy <= row_width);
3603 while (--row_width > 0);
3615 size_t skip = (bytes_to_jump-bytes_to_copy) /
3616 (
sizeof (png_uint_16));
3620 size_t c = bytes_to_copy;
3624 c -= (
sizeof (png_uint_16));
3628 if (row_width <= bytes_to_jump)
3633 row_width -= bytes_to_jump;
3635 while (bytes_to_copy <= row_width);
3642 while (--row_width > 0);
3653 if (row_width <= bytes_to_jump)
3656 sp += bytes_to_jump;
3657 dp += bytes_to_jump;
3658 row_width -= bytes_to_jump;
3659 if (bytes_to_copy > row_width)
3660 bytes_to_copy = (
unsigned int)row_width;
3679 if (end_ptr !=
NULL)
3680 *end_ptr = (png_byte)((end_byte & end_mask) | (*end_ptr & ~end_mask));
3683#ifdef PNG_READ_INTERLACING_SUPPORTED
3690 static const unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
3692 png_debug(1,
"in png_do_read_interlace");
3697 final_width = row_info->
width * png_pass_inc[
pass];
3705 unsigned int sshift, dshift;
3706 unsigned int s_start, s_end;
3708 int jstop = (
int)png_pass_inc[
pass];
3713#ifdef PNG_READ_PACKSWAP_SUPPORTED
3716 sshift = ((row_info->
width + 7) & 0x07);
3717 dshift = ((final_width + 7) & 0x07);
3726 sshift = 7 - ((row_info->
width + 7) & 0x07);
3727 dshift = 7 - ((final_width + 7) & 0x07);
3733 for (
i = 0;
i < row_info->
width;
i++)
3735 v = (png_byte)((*
sp >> sshift) & 0x01);
3736 for (
j = 0;
j < jstop;
j++)
3738 unsigned int tmp = *dp & (0x7f7f >> (7 - dshift));
3739 tmp |= (
unsigned int)(
v << dshift);
3740 *dp = (png_byte)(tmp & 0xff);
3742 if (dshift == s_end)
3749 dshift = (
unsigned int)((
int)dshift + s_inc);
3752 if (sshift == s_end)
3759 sshift = (
unsigned int)((
int)sshift + s_inc);
3768 unsigned int sshift, dshift;
3769 unsigned int s_start, s_end;
3771 int jstop = (
int)png_pass_inc[
pass];
3774#ifdef PNG_READ_PACKSWAP_SUPPORTED
3777 sshift = (((row_info->
width + 3) & 0x03) << 1);
3778 dshift = (((final_width + 3) & 0x03) << 1);
3787 sshift = ((3 - ((row_info->
width + 3) & 0x03)) << 1);
3788 dshift = ((3 - ((final_width + 3) & 0x03)) << 1);
3794 for (
i = 0;
i < row_info->
width;
i++)
3799 v = (png_byte)((*
sp >> sshift) & 0x03);
3800 for (
j = 0;
j < jstop;
j++)
3802 unsigned int tmp = *dp & (0x3f3f >> (6 - dshift));
3803 tmp |= (
unsigned int)(
v << dshift);
3804 *dp = (png_byte)(tmp & 0xff);
3806 if (dshift == s_end)
3813 dshift = (
unsigned int)((
int)dshift + s_inc);
3816 if (sshift == s_end)
3823 sshift = (
unsigned int)((
int)sshift + s_inc);
3832 unsigned int sshift, dshift;
3833 unsigned int s_start, s_end;
3836 int jstop = (
int)png_pass_inc[
pass];
3838#ifdef PNG_READ_PACKSWAP_SUPPORTED
3841 sshift = (((row_info->
width + 1) & 0x01) << 2);
3842 dshift = (((final_width + 1) & 0x01) << 2);
3851 sshift = ((1 - ((row_info->
width + 1) & 0x01)) << 2);
3852 dshift = ((1 - ((final_width + 1) & 0x01)) << 2);
3858 for (
i = 0;
i < row_info->
width;
i++)
3860 png_byte
v = (png_byte)((*
sp >> sshift) & 0x0f);
3863 for (
j = 0;
j < jstop;
j++)
3865 unsigned int tmp = *dp & (0xf0f >> (4 - dshift));
3866 tmp |= (
unsigned int)(
v << dshift);
3867 *dp = (png_byte)(tmp & 0xff);
3869 if (dshift == s_end)
3876 dshift = (
unsigned int)((
int)dshift + s_inc);
3879 if (sshift == s_end)
3886 sshift = (
unsigned int)((
int)sshift + s_inc);
3893 size_t pixel_bytes = (row_info->
pixel_depth >> 3);
3900 int jstop = (
int)png_pass_inc[
pass];
3903 for (
i = 0;
i < row_info->
width;
i++)
3910 for (
j = 0;
j < jstop;
j++)
3922 row_info->
width = final_width;
3925#ifndef PNG_READ_PACKSWAP_SUPPORTED
3942 for (
i =
bpp;
i < istop;
i++)
3944 *rp = (png_byte)(((
int)(*rp) + (
int)(*(rp-
bpp))) & 0xff);
3958 for (
i = 0;
i < istop;
i++)
3960 *rp = (png_byte)(((
int)(*rp) + (
int)(*pp++)) & 0xff);
3975 for (
i = 0;
i <
bpp;
i++)
3977 *rp = (png_byte)(((
int)(*rp) +
3978 ((
int)(*pp++) / 2 )) & 0xff);
3983 for (
i = 0;
i < istop;
i++)
3985 *rp = (png_byte)(((
int)(*rp) +
3986 (
int)(*pp++ + *(rp-
bpp)) / 2 ) & 0xff);
4002 *
row++ = (png_byte)
a;
4005 while (
row < rp_end)
4007 int b,
pa, pb, pc,
p;
4020 pa =
p < 0 ? -
p :
p;
4021 pb = pc < 0 ? -pc : pc;
4022 pc = (
p + pc) < 0 ? -(
p + pc) :
p + pc;
4039 *
row++ = (png_byte)
a;
4053 while (
row < rp_end)
4055 int a = *
row + *prev_row++;
4056 *
row++ = (png_byte)
a;
4062 while (
row < rp_end)
4064 int a,
b,
c,
pa, pb, pc,
p;
4066 c = *(prev_row -
bpp);
4078 pa =
p < 0 ? -
p :
p;
4079 pb = pc < 0 ? -pc : pc;
4080 pc = (
p + pc) < 0 ? -(
p + pc) :
p + pc;
4090 *
row++ = (png_byte)
a;
4106 unsigned int bpp = (pp->pixel_depth + 7) >> 3;
4113 png_read_filter_row_paeth_1byte_pixel;
4116 png_read_filter_row_paeth_multibyte_pixel;
4118#ifdef PNG_FILTER_OPTIMIZATIONS
4127 PNG_FILTER_OPTIMIZATIONS(pp,
bpp);
4141 if (pp->read_filter[0] ==
NULL)
4142 png_init_filter_functions(pp);
4144 pp->read_filter[
filter-1](row_info,
row, prev_row);
4148#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
4154 png_ptr->zstream.next_out = output;
4155 png_ptr->zstream.avail_out = 0;
4165 if (
png_ptr->zstream.avail_in == 0)
4170 while (
png_ptr->idat_size == 0)
4179 png_error(
png_ptr,
"Not enough image data");
4182 avail_in =
png_ptr->IDAT_read_size;
4184 if (avail_in >
png_ptr->idat_size)
4195 png_ptr->idat_size -= avail_in;
4198 png_ptr->zstream.avail_in = avail_in;
4206 if (
out > avail_out)
4215 png_ptr->zstream.next_out = tmpbuf;
4216 png_ptr->zstream.avail_out = (
sizeof tmpbuf);
4230 avail_out +=
png_ptr->zstream.avail_out;
4233 avail_out += (
sizeof tmpbuf) -
png_ptr->zstream.avail_out;
4235 png_ptr->zstream.avail_out = 0;
4246 png_chunk_benign_error(
png_ptr,
"Extra compressed data");
4263 }
while (avail_out > 0);
4271 png_error(
png_ptr,
"Not enough image data");
4274 png_chunk_benign_error(
png_ptr,
"Too much image data");
4312 png_ptr->zstream.avail_in = 0;
4332 static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
4335 static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
4338 static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
4341 static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
4365 png_pass_inc[
png_ptr->pass] - 1 -
4366 png_pass_start[
png_ptr->pass]) /
4372 png_pass_yinc[
png_ptr->pass] - 1 -
4373 png_pass_ystart[
png_ptr->pass]) /
4387 png_read_finish_IDAT(
png_ptr);
4397 static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
4400 static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
4403 static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
4406 static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
4408 unsigned int max_pixel_depth;
4413#ifdef PNG_READ_TRANSFORMS_SUPPORTED
4414 png_init_read_transformations(
png_ptr);
4420 png_pass_ystart[0]) / png_pass_yinc[0];
4426 png_pass_inc[
png_ptr->pass] - 1 -
4427 png_pass_start[
png_ptr->pass]) /
4437 max_pixel_depth = (
unsigned int)
png_ptr->pixel_depth;
4451 max_pixel_depth = 8;
4454#ifdef PNG_READ_EXPAND_SUPPORTED
4460 max_pixel_depth = 32;
4463 max_pixel_depth = 24;
4468 if (max_pixel_depth < 8)
4469 max_pixel_depth = 8;
4472 max_pixel_depth *= 2;
4479 max_pixel_depth *= 4;
4480 max_pixel_depth /= 3;
4486#ifdef PNG_READ_EXPAND_16_SUPPORTED
4489# ifdef PNG_READ_EXPAND_SUPPORTED
4496 max_pixel_depth *= 2;
4500 png_ptr->transformations &= ~PNG_EXPAND_16;
4504#ifdef PNG_READ_FILLER_SUPPORTED
4509 if (max_pixel_depth <= 8)
4510 max_pixel_depth = 16;
4513 max_pixel_depth = 32;
4519 if (max_pixel_depth <= 32)
4520 max_pixel_depth = 32;
4523 max_pixel_depth = 64;
4528#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
4541 if (max_pixel_depth <= 16)
4542 max_pixel_depth = 32;
4545 max_pixel_depth = 64;
4550 if (max_pixel_depth <= 8)
4553 max_pixel_depth = 32;
4556 max_pixel_depth = 24;
4560 max_pixel_depth = 64;
4563 max_pixel_depth = 48;
4568#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) && \
4569defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
4572 unsigned int user_pixel_depth =
png_ptr->user_transform_depth *
4573 png_ptr->user_transform_channels;
4575 if (user_pixel_depth > max_pixel_depth)
4576 max_pixel_depth = user_pixel_depth;
4583 png_ptr->maximum_pixel_depth = (png_byte)max_pixel_depth;
4584 png_ptr->transformed_pixel_depth = 0;
4594 1 + ((max_pixel_depth + 7) >> 3U);
4596#ifdef PNG_MAX_MALLOC_64K
4598 png_error(
png_ptr,
"This image requires a row greater than 64KB");
4601 if (row_bytes + 48 >
png_ptr->old_big_row_buf_size)
4615#ifdef PNG_ALIGNED_MEMORY_SUPPORTED
4637 png_ptr->old_big_row_buf_size = row_bytes + 48;
4640#ifdef PNG_MAX_MALLOC_64K
4641 if (
png_ptr->rowbytes > 65535)
4642 png_error(
png_ptr,
"This image requires a row greater than 64KB");
4646 png_error(
png_ptr,
"Row has too many bytes to allocate in memory");
4666 png_ptr->read_buffer_size = 0;
ACPI_SIZE strlen(const char *String)
EXPORT int errmsg(char *msg, va_alist)
static int inflateReset2(z_streamp strm, int windowBits)
static int inflateReset(z_streamp strm)
int inflate(z_streamp strm, int flush)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLuint GLuint GLsizei GLenum type
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLenum GLenum GLenum input
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
void MSVCRT() terminate()
#define memcpy(s1, s2, n)
#define PNG_COLOR_TYPE_RGB
#define PNG_COLOR_TYPE_RGB_ALPHA
#define PNG_COLOR_TYPE_GRAY_ALPHA
#define PNG_COLOR_TYPE_GRAY
#define PNG_COLOR_TYPE_PALETTE
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
#define png_get_uint_16(buf)
#define PNG_MAXIMUM_INFLATE_WINDOW
#define PNG_HANDLE_CHUNK_IF_SAFE
#define png_get_int_32(buf)
#define PNG_MAX_PALETTE_LENGTH
#define PNG_ITXT_COMPRESSION_NONE
#define PNG_EQUATION_ARBITRARY
#define PNG_TEXT_COMPRESSION_zTXt
#define PNG_EQUATION_BASE_E
#define PNG_PASS_START_COL(pass)
#define PNG_TEXT_COMPRESSION_NONE
#define PNG_EQUATION_LAST
#define PNG_FILTER_VALUE_AVG
png_sPLT_entry * png_sPLT_entryp
#define PNG_COLOR_MASK_COLOR
#define PNG_FILTER_VALUE_LAST
#define PNG_FILTER_VALUE_UP
struct png_sPLT_entry_struct png_sPLT_entry
#define PNG_IO_CHUNK_DATA
#define png_get_uint_32(buf)
#define PNG_IGNORE_ADLER32
#define PNG_HANDLE_CHUNK_NEVER
#define PNG_HANDLE_CHUNK_ALWAYS
const png_struct *PNG_RESTRICT png_const_structrp
#define PNG_EQUATION_HYPERBOLIC
#define PNG_FILTER_VALUE_PAETH
#define PNG_FILTER_VALUE_NONE
png_info *PNG_RESTRICT png_inforp
#define PNG_PASS_COL_OFFSET(pass)
#define PNG_EQUATION_LINEAR
#define PNG_COMPRESSION_TYPE_BASE
#define PNG_FILTER_VALUE_SUB
#define PNG_HANDLE_CHUNK_AS_DEFAULT
png_struct *PNG_RESTRICT png_structrp
png_const_structrp png_const_inforp info_ptr
#define PNG_ITXT_COMPRESSION_zTXt
png_int_32 png_fixed_point
const png_byte * png_const_bytep
const png_uint_16 * png_const_uint_16p
png_uint_16 * png_uint_16p
png_uint_32 * png_uint_32p
const png_uint_32 * png_const_uint_32p
const char * png_const_charp
#define png_debug2(l, m, p1, p2)
#define png_debug1(l, m, p1)
#define PNG_INFLATE_BUF_SIZE
#define PNG_READ_EXPAND_SUPPORTED
#define PNG_READ_PACK_SUPPORTED
#define PNG_USER_CHUNK_MALLOC_MAX
#define PNG_READ_FILLER_SUPPORTED
#define PNG_UNEXPECTED_ZLIB_RETURN
#define PNG_UNUSED(param)
#define PNG_HAVE_PNG_SIGNATURE
#define PNG_ROWBYTES(pixel_bits, width)
#define PNG_FLAG_CRC_CRITICAL_USE
#define PNG_FLAG_CRC_ANCILLARY_USE
#define png_app_error(pp, s)
#define png_app_warning(pp, s)
#define PNG_FLAG_BENIGN_ERRORS_WARN
#define PNG_FLAG_CRC_ANCILLARY_NOWARN
#define PNG_INFLATE(pp, flush)
#define PNG_USER_TRANSFORM
#define png_aligncastconst(type, value)
#define png_aligncast(type, value)
#define PNG_FLAG_CRC_ANCILLARY_MASK
#define PNG_CSTRING_FROM_CHUNK(s, c)
#define PNG_FLAG_CRC_CRITICAL_IGNORE
#define PNG_CHUNK_FROM_STRING(s)
#define PNG_FLAG_ZSTREAM_ENDED
#define PNG_FLAG_ZSTREAM_INITIALIZED
#define png_isaligned(ptr, type)
#define PNG_FLAG_ROW_INIT
#define PNG_CHUNK_CRITICAL(c)
#define PNG_CHUNK_ANCILLARY(c)
#define png_voidcast(type, value)
#define PNG_STRING_FROM_CHUNK(s, c)
#define PNGZ_INPUT_CAST(b)
#define inflateInit2(strm, windowBits)
#define inflateInit(strm)
int ZEXPORT inflateValidate(z_streamp strm, int check)