mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
libpng: Update to 1.6.47
This commit is contained in:
52
thirdparty/libpng/pngwutil.c
vendored
52
thirdparty/libpng/pngwutil.c
vendored
@@ -1132,10 +1132,9 @@ png_write_sRGB(png_structrp png_ptr, int srgb_intent)
|
||||
/* Write an iCCP chunk */
|
||||
void /* PRIVATE */
|
||||
png_write_iCCP(png_structrp png_ptr, png_const_charp name,
|
||||
png_const_bytep profile)
|
||||
png_const_bytep profile, png_uint_32 profile_len)
|
||||
{
|
||||
png_uint_32 name_len;
|
||||
png_uint_32 profile_len;
|
||||
png_byte new_name[81]; /* 1 byte for the compression byte */
|
||||
compression_state comp;
|
||||
png_uint_32 temp;
|
||||
@@ -1148,11 +1147,12 @@ png_write_iCCP(png_structrp png_ptr, png_const_charp name,
|
||||
if (profile == NULL)
|
||||
png_error(png_ptr, "No profile for iCCP chunk"); /* internal error */
|
||||
|
||||
profile_len = png_get_uint_32(profile);
|
||||
|
||||
if (profile_len < 132)
|
||||
png_error(png_ptr, "ICC profile too short");
|
||||
|
||||
if (png_get_uint_32(profile) != profile_len)
|
||||
png_error(png_ptr, "Incorrect data in iCCP");
|
||||
|
||||
temp = (png_uint_32) (*(profile+8));
|
||||
if (temp > 3 && (profile_len & 0x03))
|
||||
png_error(png_ptr, "ICC profile length invalid (not a multiple of 4)");
|
||||
@@ -1511,6 +1511,50 @@ png_write_cICP(png_structrp png_ptr,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_cLLI_SUPPORTED
|
||||
void /* PRIVATE */
|
||||
png_write_cLLI_fixed(png_structrp png_ptr, png_uint_32 maxCLL,
|
||||
png_uint_32 maxFALL)
|
||||
{
|
||||
png_byte buf[8];
|
||||
|
||||
png_debug(1, "in png_write_cLLI_fixed");
|
||||
|
||||
png_save_uint_32(buf, maxCLL);
|
||||
png_save_uint_32(buf + 4, maxFALL);
|
||||
|
||||
png_write_complete_chunk(png_ptr, png_cLLI, buf, 8);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_mDCV_SUPPORTED
|
||||
void /* PRIVATE */
|
||||
png_write_mDCV_fixed(png_structrp png_ptr,
|
||||
png_uint_16 red_x, png_uint_16 red_y,
|
||||
png_uint_16 green_x, png_uint_16 green_y,
|
||||
png_uint_16 blue_x, png_uint_16 blue_y,
|
||||
png_uint_16 white_x, png_uint_16 white_y,
|
||||
png_uint_32 maxDL, png_uint_32 minDL)
|
||||
{
|
||||
png_byte buf[24];
|
||||
|
||||
png_debug(1, "in png_write_mDCV_fixed");
|
||||
|
||||
png_save_uint_16(buf + 0, red_x);
|
||||
png_save_uint_16(buf + 2, red_y);
|
||||
png_save_uint_16(buf + 4, green_x);
|
||||
png_save_uint_16(buf + 6, green_y);
|
||||
png_save_uint_16(buf + 8, blue_x);
|
||||
png_save_uint_16(buf + 10, blue_y);
|
||||
png_save_uint_16(buf + 12, white_x);
|
||||
png_save_uint_16(buf + 14, white_y);
|
||||
png_save_uint_32(buf + 16, maxDL);
|
||||
png_save_uint_32(buf + 20, minDL);
|
||||
|
||||
png_write_complete_chunk(png_ptr, png_mDCV, buf, 24);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_eXIf_SUPPORTED
|
||||
/* Write the Exif data */
|
||||
void /* PRIVATE */
|
||||
|
||||
Reference in New Issue
Block a user