mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[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:
committed by
Glenn Randers-Pehrson
parent
3c2ae60f46
commit
f3f7e14727
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user