632
638
/* set the palette if there is one. REQUIRED for indexed-color images */
633
639
palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH
635
641
/* ... set palette colors ... */
636
642
png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH);
637
643
/* You must not free palette here, because png_set_PLTE only makes a link to