summaryrefslogtreecommitdiff
path: root/pngset.c
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2011-09-09 07:32:37 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2011-09-09 07:32:37 -0500
commitf3f7e147278af44f66974a3d453496ce4d6ed0e3 (patch)
tree0311ba4f04cb2c2cf2e82dfc70120e4a9a923476 /pngset.c
parent3c2ae60f46030cb6326ebd96a4bdf81b9de69da8 (diff)
downloadlibpng-f3f7e147278af44f66974a3d453496ce4d6ed0e3.tar.gz
[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.
Diffstat (limited to 'pngset.c')
-rw-r--r--pngset.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pngset.c b/pngset.c
index ac90d467f..79968d3b8 100644
--- a/pngset.c
+++ b/pngset.c
@@ -620,7 +620,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
{
png_charp new_iccp_name;
png_bytep new_iccp_profile;
- png_uint_32 length;
+ png_size_t length;
png_debug1(1, "in %s storage function", "iCCP");
@@ -966,10 +966,10 @@ png_set_sPLT(png_structp png_ptr,
{
png_sPLT_tp to = np + info_ptr->splt_palettes_num + i;
png_const_sPLT_tp from = entries + i;
- png_uint_32 length;
+ png_size_t length;
length = png_strlen(from->name) + 1;
- to->name = (png_charp)png_malloc_warn(png_ptr, (png_size_t)length);
+ to->name = (png_charp)png_malloc_warn(png_ptr, length);
if (to->name == NULL)
{
@@ -980,7 +980,7 @@ png_set_sPLT(png_structp png_ptr,
png_memcpy(to->name, from->name, length);
to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
- (png_size_t)(from->nentries * png_sizeof(png_sPLT_entry)));
+ from->nentries * png_sizeof(png_sPLT_entry));
if (to->entries == NULL)
{