Commits
Joshua Root authored 2514c3e90ff
26 26 | - |
27 27 | png_set_IHDR(png_ptr, info_ptr, width, height, 8 /* bit_depth */ , |
28 28 | PNG_COLOR_TYPE_PALETTE, |
29 29 | PNG_INTERLACE_NONE, |
30 30 | @@ -434,7 +434,8 @@ void writepng(char *filename, |
31 31 | png_write_end(png_ptr, info_ptr); |
32 32 | |
33 33 | /* if you malloced the palette, free it here */ |
34 34 | - free(info_ptr->palette); |
35 35 | + if (eight_bit) |
36 - | + png_free(palette); |
36 + | + png_free(png_ptr, palette); |
37 37 | |
38 38 | /* if you allocated any text comments, free them here */ |
39 39 |