blob: 07b4ab1db8fb7f1674151d9e8654d91807867ae1 [file] [log] [blame]
Glenn Randers-Pehrson896239b1998-04-21 15:03:57 -05001
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -06002Known bugs and suggested enhancements in libpng-1.0.6
Glenn Randers-Pehrson896239b1998-04-21 15:03:57 -05003
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050041. April 24, 2000 -- BUG -- binary incompatibility
5
6 Libpng-1.0.6 is binary incompatible with old applications that
7 allocate the png_struct and png_info structures themselves instead
8 of using png_create_*(). They do not allocate enough space for
9 the structures because they have an incorrect notion of
10 sizeof(png_struct) and sizeof(png_info). Although such applications
11 should be considered broken rather than considering libpng to be broken,
12 they are numerous and include products of the PNG group, such
13 as gif2png and pnmtopng-2.36 (pnmtopng-2.37 is OK), so libpng will
14 be fixed in version 1.0.7 to work around this problem.
15
16 Applications that use png_create_*() instead of png_ptr=malloc(...)
17 are immune to this problem.
18
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -050019 STATUS: Fixed in libpng-1.0.6ad, libpng-1.0.6j, and patch-d
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050020 which are currently being tested by the PNG group.
21 The fix necessarily reintroduces a binary incompatibility with any
22 application that makes direct access to the png_info and
23 png_struct members that deal with the pCAL chunk, palette_lookup,
24 dither_index, time_buffer, or weighted filtering, i.e., any members
25 coming after the new "free_me" member of either structure. It
26 is believed that applications affected by this reintroduced binary
27 incompatibility are rare (none are known to the PNG group). An
28 effective workaround for this and the next bug is to recompile the
29 old applications with the installed version of libpng.
30
312. April 23, 2000 -- BUG -- binary incompatibility
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050032
33 Libpng-1.0.6 introduced binary incompatibility for applications that
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050034 make direct access to members of the png_struct and png_info structures,
35 due to the insertion of the free_me member ahead of some previously
36 existing members.
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050037
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050038 Applications that use png_set_*(), png_get_*() are immune to this
39 problem, but people are still to this day writing applications that
40 make ill-advised direct access to members of the png_struct and
41 png_info structures, so libpng-1.0.6 will be patched to work around
42 this problem.
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050043
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -050044 STATUS: Fixed in libpng-1.0.6j and patch-d, which are currently being
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050045 tested by the PNG group. Users can work around the problem without
46 patching libpng by recompiling their applications.
47
483. April 15, 2000 -- BUG -- pnggccrd.c
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050049
50 If PNG_NO_GLOBAL_ARRAYS is defined, pnggccrd.c will not compile.
51
52 STATUS: Fixed in libpng-1.0.6g
53
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500544. April 1, 2000 -- BUG
Glenn Randers-Pehrson896239b1998-04-21 15:03:57 -050055
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060056 Under some circumstances old applications that make direct access to
57 the info_ptr->text and its members might free the same memory that
58 is also free'ed by libpng during the png_destroy_struct process.
59
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050060 Fixed in libpng-1.0.6-patch-c and libpng-1.0.6d. The PNG_FREE_TEXT flag
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060061 bit in info_ptr->free_me is now checked to make sure libpng is responsible
62 for freeing the memory.
63
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500645. April 1, 2000 -- BUG
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060065
66 The non-ISO-C "strdup()" function is used in png.c
67
68 STATUS: The function has been simplified and no longer uses strdup()
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050069 in libpng-1.0.6-patch-c and libpng-1.0.6d.
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060070
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500716. March 24, 2000 -- BUG
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060072
73 The png_set_rgb_to_gray_fixed() function is setting incorrect weighting
74 factors.
75
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050076 STATUS: Fixed in libpng-1.0.6-patch-b and libpng-1.0.6d.
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060077
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500787. March 22, 2000 -- BUG
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060079
80 There are some printf() and fprintf() statements active in pngwutil.c
81 when PNG_NO_STDIO and PNG_sCAL_SUPPORTED are both defined.
82
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050083 STATUS: Fixed in libpng-1.0.6-patch-a and libpng-1.0.6d. The strcpy()
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060084 function is used instead.
85
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500868. March 22, 2000 -- BUG
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060087
88 The length of the iCCP chunk data is calculated incorrectly; because
89 it can contain zeroes, strlen() doesn't work.
90
Glenn Randers-Pehrson228bd392000-04-23 23:14:02 -050091 STATUS: Fixed in libpng-1.0.6-patch-a and libpng-1.0.6d by adding a
Glenn Randers-Pehrson81fdf8a2000-04-07 10:34:56 -050092 data_length parameter to the png_decompress_chunk() function.
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -060093
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500949. March 15, 1998 -- OPTIMIZATION -- Kevin Bracey
Glenn Randers-Pehrson896239b1998-04-21 15:03:57 -050095
96 Loops need to be optimized everywhere
97
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050098 Make them count down instead of up -- Kevin Bracey
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -060099
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -0500100 Optimizing compilers don't need this, and making
101 the change would be error prone -- Tom Lane, Glenn R-P
Glenn Randers-Pehrson896239b1998-04-21 15:03:57 -0500102
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -0500103 Question whether i-- or --i is better.
Glenn Randers-Pehrson896239b1998-04-21 15:03:57 -0500104
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -0500105 STATUS: Under investigation, postponed until after
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600106 libpng-1.1.0. About 160 loops will be turned around
107 in libpng-1.1.Nn, for testing.
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -0600108
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050010910. July 4, 1998 -- ENHANCEMENT -- Glenn R-P
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -0600110
Glenn Randers-Pehrsonbcfd15d1999-10-01 14:22:25 -0500111 libpng-1.0.5 and earlier transform colors to gamma=1.0 space for
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -0600112 merging with background, and then back to the image's gamma. The
113 bit_depth of the intermediate (gamma=1.0) representation is probably
114 not sufficient. In the typical gamma=1/2.2 situation, the linear
115 pixels need about 4 more bits than the gamma-encoded ones, to avoid
116 loss of precision. A similar situation exists with the rgb_to_gray
117 operation.
118
119 STATUS: under development.
120
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050012111. September 1999 -- ENHANCEMENT --
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500122
123 It should be possible to use libpng without floating-point aritmetic.
124
125 STATUS: Under investigation, implementation postponed until after
Glenn Randers-Pehrson81fdf8a2000-04-07 10:34:56 -0500126 libpng-1.0.6. The application interface will change because replacements
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500127 for the png_set_gAMA(), png_set_cHRM(), and corresponding png_get_()
128 functions will be needed.
Glenn Randers-Pehrson896239b1998-04-21 15:03:57 -0500129
Glenn Randers-Pehrson68ea2432000-04-01 21:10:05 -0600130 Much of this was completed in libpng-1.0.6, but gamma compensation
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600131 is not yet done in fixed-point arithmetic.
132