Imported from libpng-1.0.11beta3.tar

This commit is contained in:
Glenn Randers-Pehrson
2001-04-14 20:15:41 -05:00
parent f64a06f5ec
commit e1eff58f87
53 changed files with 722 additions and 254 deletions

View File

@@ -603,7 +603,10 @@ 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, PNG_MAX_PALETTE_LENGTH * sizeof (png_color));
palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH
* sizeof (png_color));
if (palette == NULL)
png_error(png_ptr, "Example: malloc of palette failed");
/* ... 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