summaryrefslogtreecommitdiff
path: root/pngset.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>1999-09-17 12:27:26 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2009-04-06 16:04:32 -0500
commit4393a9ad6bfe8f7d95d6cd3fa130c34704a61352 (patch)
treeecba47a0a101a2a9f6336a1ca5b07a104e9b6d49 /pngset.c
parent87544ac62be7d29561270b85271125353e281aba (diff)
downloadlibpng-4393a9ad6bfe8f7d95d6cd3fa130c34704a61352.tar.gz
Imported from libpng-1.0.4-pre1.tarv1.0.4-pre1
Diffstat (limited to 'pngset.c')
-rw-r--r--pngset.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/pngset.c b/pngset.c
index 320083638..07fc581fc 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct
*
- * libpng 1.0.3 - January 14, 1999
+ * libpng 1.0.4 - September 17, 1999
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@@ -107,7 +107,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
/* check for overflow */
rowbytes_per_pixel = (info_ptr->pixel_depth + 7) >> 3;
- if (( width > (png_uint_32)2147483647L/rowbytes_per_pixel))
+ if (( width > PNG_MAX_UINT/rowbytes_per_pixel))
{
png_warning(png_ptr,
"Width too large to process image data; rowbytes will overflow.");
@@ -344,7 +344,8 @@ void
png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time)
{
png_debug1(1, "in %s storage function\n", "tIME");
- if (png_ptr == NULL || info_ptr == NULL)
+ if (png_ptr == NULL || info_ptr == NULL ||
+ (png_ptr->flags & PNG_FLAG_WROTE_tIME))
return;
png_memcpy(&(info_ptr->mod_time), mod_time, sizeof (png_time));
@@ -378,3 +379,13 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
}
#endif
+#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED)
+void
+png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted)
+{
+ png_debug1(1, "in png_permit_empty_plte\n", "");
+ if (png_ptr == NULL)
+ return;
+ png_ptr->empty_plte_permitted=(png_byte)empty_plte_permitted;
+}
+#endif