summaryrefslogtreecommitdiff
path: root/example.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2004-07-28 08:20:44 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2009-04-06 16:07:40 -0500
commit5fea36fb0018cdc68b7a61ae2d149c9cba6eb3ba (patch)
tree6a40f463e59f3767b85d55a06705389728e84649 /example.c
parent5b5dcf8b88d2fa385d36ac0caac73e6ffa9e93e4 (diff)
Imported from libpng-1.2.6beta4.tar
Diffstat (limited to 'example.c')
-rw-r--r--example.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/example.c b/example.c
index 7956cf7ab..fb1f5ed1d 100644
--- a/example.c
+++ b/example.c
@@ -631,7 +631,7 @@ void write_png(char *file_name /* , ... other image information ... */)
/* set the palette if there is one. REQUIRED for indexed-color images */
palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH
- * sizeof (png_color));
+ * png_sizeof (png_color));
/* ... set palette colors ... */
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
@@ -741,6 +741,7 @@ void write_png(char *file_name /* , ... other image information ... */)
png_uint_32 k, height, width;
png_byte image[height][width*bytes_per_pixel];
png_bytep row_pointers[height];
+
for (k = 0; k < height; k++)
row_pointers[k] = image + k*width*bytes_per_pixel;