Fix duplicate tIME chunk from png_write_png

Also add an example program, pngcp.c, which illustrates the problem when used to
copy pngtest.png (the result is an invalid PNG because the tIME chunk is
duplicated.)

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2015-12-18 14:42:29 -08:00
parent c75a0a40b4
commit 8d48a512bd
3 changed files with 545 additions and 0 deletions

View File

@@ -400,6 +400,9 @@ struct png_struct_def
unsigned int palette_index_check_disabled :1; /* defaults to 0, 'enabled' */
unsigned int palette_index_check_issued :1; /* error message output */
#endif /* CHECK_FOR_INVALID_INDEX */
#ifdef PNG_WRITE_tIME_SUPPORTED
unsigned int wrote_tIME :1; /* Stop writing of duplicate tIME chunks */
#endif /* WRITE_tIME */
#ifdef PNG_READ_tRNS_SUPPORTED
png_color_16 trans_color; /* transparent color for non-paletted files */
#endif /* READ_tRNS */