[libpng15] Fixed 64-bit compilation errors (gcc). The errors fixed relate

to conditions where types that are 32 bits in the GCC 32-bit
world (uLong and png_size_t) become 64 bits in the 64-bit
world.  This produces potential truncation errors which the
compiler correctly flags.
This commit is contained in:
John Bowler
2011-09-09 07:32:37 -05:00
committed by Glenn Randers-Pehrson
parent 3c2ae60f46
commit f3f7e14727
9 changed files with 83 additions and 45 deletions

View File

@@ -2217,7 +2217,10 @@ modifier_crc(png_bytep buffer)
* the buffer, at the start.
*/
uInt datalen = png_get_uint_32(buffer);
png_save_uint_32(buffer+datalen+8, crc32(0L, buffer+4, datalen+4));
uLong crc = crc32(0L, buffer+4, datalen+4);
/* The cast to png_uint_32 is safe because a crc32 is always a 32 bit value.
*/
png_save_uint_32(buffer+datalen+8, (png_uint_32)crc);
}
static void