summaryrefslogtreecommitdiff
path: root/example.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2000-12-28 07:50:05 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2009-04-06 16:05:49 -0500
commit76e5fd642ee752739be2327625d77e322a59813f (patch)
tree78d18f6314183e5adadf773ee0939773a38b1ae4 /example.c
parentf05f8033b80ebebafac9391bae6d6f46b2ffac9c (diff)
Imported from libpng-1.0.9beta7.tar
Diffstat (limited to 'example.c')
-rw-r--r--example.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/example.c b/example.c
index 47a022580..1e953c84e 100644
--- a/example.c
+++ b/example.c
@@ -603,9 +603,9 @@ void write_png(char *file_name /* , ... other image information ... */)
PNG_INTERLACE_????, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
/* set the palette if there is one. REQUIRED for indexed-color images */
- palette = (png_colorp)png_malloc(png_ptr, 256 * sizeof (png_color));
+ palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH * sizeof (png_color));
/* ... set palette colors ... */
- png_set_PLTE(png_ptr, info_ptr, palette, 256);
+ png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH);
/* You must not free palette here, because png_set_PLTE only makes a link to
the palette that you malloced. Wait until you are about to destroy
the png structure. */