1335 if ((png_ptr->colorspace.
flags & PNG_COLORSPACE_INVALID) != 0)
1344 if ((png_ptr->colorspace.
flags & PNG_COLORSPACE_HAVE_INTENT) == 0)
1346 uInt read_length, keyword_length;
1353 if (read_length >
length)
1360 while (keyword_length < 80 && keyword_length < read_length &&
1361 keyword[keyword_length] != 0)
1365 if (keyword_length >= 1 && keyword_length <= 79)
1370 if (keyword_length+1 < read_length &&
1373 read_length -= keyword_length+2;
1377 Byte profile_header[132];
1384 (
sizeof local_buffer), &
length, profile_header, &size,
1391 const png_uint_32 profile_length =
1395 keyword, profile_length) != 0)
1401 keyword, profile_length, profile_header,
1410 profile_header+128);
1414 if (profile != NULL)
1416 memcpy(profile, profile_header,
1417 (
sizeof profile_header));
1419 size = 12 * tag_count;
1422 (
sizeof local_buffer), &
length,
1423 profile + (
sizeof profile_header), &size, 0);
1431 &png_ptr->colorspace, keyword, profile_length,
1437 size = profile_length - (
sizeof profile_header)
1441 (
sizeof local_buffer), &
length,
1442 profile + (
sizeof profile_header) +
1443 12 * tag_count, &size, 1);
1447 errmsg =
"extra compressed data";
1458 "extra compressed data");
1464 # ifdef PNG_sRGB_SUPPORTED 1467 &png_ptr->colorspace, profile,
1472 if (info_ptr != NULL)
1480 if (info_ptr->iccp_name != NULL)
1482 memcpy(info_ptr->iccp_name, keyword,
1484 info_ptr->iccp_proflen =
1486 info_ptr->iccp_profile = profile;
1487 png_ptr->read_buffer = NULL;
1494 png_ptr->colorspace.
flags |=
1495 PNG_COLORSPACE_INVALID;
1496 errmsg =
"out of memory";
1505 if (info_ptr != NULL)
1516 errmsg =
"truncated";
1530 errmsg =
"out of memory";
1551 errmsg =
"bad compression method";
1555 errmsg =
"bad keyword";
1559 errmsg =
"too many profiles";
1565 png_ptr->colorspace.
flags |= PNG_COLORSPACE_INVALID;
PNG_IMPEXP void() png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp warning_message)
Definition: pngerror.c:514
int png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile)
Definition: png.c:2125
z_stream zstream
Definition: pngstruct.h:184
const char * png_const_charp
Definition: pngconf.h:611
Bytef * next_in
Definition: zlib.h:86
#define png_iCCP
Definition: pngpriv.h:764
uInt avail_in
Definition: zlib.h:87
png_byte * png_bytep
Definition: pngconf.h:600
unsigned char Byte
Definition: test_imu.cpp:41
#define png_debug(l, m)
Definition: pngdebug.h:146
char * msg
Definition: zlib.h:94
#define PNG_FREE_ICCP
Definition: png.h:1913
#define PNG_HAVE_PLTE
Definition: png.h:786
#define png_voidcast(type, value)
Definition: pngpriv.h:408
png_voidp png_malloc_base(png_const_structrp png_ptr, png_alloc_size_t size)
Definition: pngmem.c:69
void png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, int num)
Definition: png.c:442
png_byte color_type
Definition: pngstruct.h:252
png_size_t png_alloc_size_t
Definition: pngconf.h:578
#define PNG_HAVE_IDAT
Definition: pngpriv.h:544
#define PNG_INFLATE_BUF_SIZE
Definition: pnglibconf.h:194
#define PNG_HAVE_IHDR
Definition: png.h:785
PNG_IMPEXP void() png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)
Definition: pngerror.c:497
int png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, int color_type)
Definition: png.c:1942
png_uint_32 flags
Definition: pngstruct.h:180
PNG_IMPEXP void() png_chunk_error(png_const_structrp png_ptr, png_const_charp error_message)
Definition: pngerror.c:481
#define PNG_FLAG_BENIGN_ERRORS_WARN
Definition: pngpriv.h:621
void png_icc_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_bytep profile, uLong adler)
Definition: png.c:2356
int png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
Definition: pngrutil.c:202
uLong adler
Definition: zlib.h:102
png_uint_32 length
Definition: png.c:2173
#define PNG_COMPRESSION_TYPE_BASE
Definition: png.h:819
Byte Bytef
Definition: zconf.h:377
png_uint_32() png_get_uint_32(png_const_bytep buf)
Definition: pngrutil.c:68
png_uint_32 valid
Definition: pnginfo.h:61
png_uint_32 mode
Definition: pngstruct.h:179
void png_crc_read(png_structrp png_ptr, png_bytep buf, png_uint_32 length)
Definition: pngrutil.c:187
static int png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
Definition: pngrutil.c:332
#define Z_OK
Definition: zlib.h:173
static png_bytep png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size, int warn)
Definition: pngrutil.c:289
int png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length)
Definition: png.c:1931
png_uint_32 free_me
Definition: pnginfo.h:221
png_uint_32 zowner
Definition: pngstruct.h:183
void png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
Definition: png.c:1175
#define PNG_INFO_iCCP
Definition: png.h:885
unsigned int uInt
Definition: zconf.h:370
static int png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size, png_uint_32p chunk_bytes, png_bytep next_out, png_alloc_size_t *out_size, int finish)
Definition: pngrutil.c:728