Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 1 | |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 2 | Known bugs and suggested enhancements in libpng-1.0.6 |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 3 | |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 4 | 1. 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-Pehrson | 98c9d73 | 2000-05-03 21:06:11 -0500 | [diff] [blame] | 19 | STATUS: Fixed in libpng-1.0.6ad, libpng-1.0.6j, and patch-d |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 20 | 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 | |
| 31 | 2. April 23, 2000 -- BUG -- binary incompatibility |
Glenn Randers-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 32 | |
| 33 | Libpng-1.0.6 introduced binary incompatibility for applications that |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 34 | 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-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 37 | |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 38 | 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-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 43 | |
Glenn Randers-Pehrson | 98c9d73 | 2000-05-03 21:06:11 -0500 | [diff] [blame] | 44 | STATUS: Fixed in libpng-1.0.6j and patch-d, which are currently being |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 45 | tested by the PNG group. Users can work around the problem without |
| 46 | patching libpng by recompiling their applications. |
| 47 | |
| 48 | 3. April 15, 2000 -- BUG -- pnggccrd.c |
Glenn Randers-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 49 | |
| 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-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 54 | 4. April 1, 2000 -- BUG |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 55 | |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 56 | 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-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 60 | Fixed in libpng-1.0.6-patch-c and libpng-1.0.6d. The PNG_FREE_TEXT flag |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 61 | bit in info_ptr->free_me is now checked to make sure libpng is responsible |
| 62 | for freeing the memory. |
| 63 | |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 64 | 5. April 1, 2000 -- BUG |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 65 | |
| 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-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 69 | in libpng-1.0.6-patch-c and libpng-1.0.6d. |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 70 | |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 71 | 6. March 24, 2000 -- BUG |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 72 | |
| 73 | The png_set_rgb_to_gray_fixed() function is setting incorrect weighting |
| 74 | factors. |
| 75 | |
Glenn Randers-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 76 | STATUS: Fixed in libpng-1.0.6-patch-b and libpng-1.0.6d. |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 77 | |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 78 | 7. March 22, 2000 -- BUG |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 79 | |
| 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-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 83 | STATUS: Fixed in libpng-1.0.6-patch-a and libpng-1.0.6d. The strcpy() |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 84 | function is used instead. |
| 85 | |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 86 | 8. March 22, 2000 -- BUG |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 87 | |
| 88 | The length of the iCCP chunk data is calculated incorrectly; because |
| 89 | it can contain zeroes, strlen() doesn't work. |
| 90 | |
Glenn Randers-Pehrson | 228bd39 | 2000-04-23 23:14:02 -0500 | [diff] [blame] | 91 | STATUS: Fixed in libpng-1.0.6-patch-a and libpng-1.0.6d by adding a |
Glenn Randers-Pehrson | 81fdf8a | 2000-04-07 10:34:56 -0500 | [diff] [blame] | 92 | data_length parameter to the png_decompress_chunk() function. |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 93 | |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 94 | 9. March 15, 1998 -- OPTIMIZATION -- Kevin Bracey |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 95 | |
| 96 | Loops need to be optimized everywhere |
| 97 | |
Glenn Randers-Pehrson | 345bc27 | 1998-06-14 14:43:31 -0500 | [diff] [blame] | 98 | Make them count down instead of up -- Kevin Bracey |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 99 | |
Glenn Randers-Pehrson | 345bc27 | 1998-06-14 14:43:31 -0500 | [diff] [blame] | 100 | Optimizing compilers don't need this, and making |
| 101 | the change would be error prone -- Tom Lane, Glenn R-P |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 102 | |
Glenn Randers-Pehrson | 345bc27 | 1998-06-14 14:43:31 -0500 | [diff] [blame] | 103 | Question whether i-- or --i is better. |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 104 | |
Glenn Randers-Pehrson | 345bc27 | 1998-06-14 14:43:31 -0500 | [diff] [blame] | 105 | STATUS: Under investigation, postponed until after |
Glenn Randers-Pehrson | 166c5a3 | 1999-12-10 09:43:02 -0600 | [diff] [blame] | 106 | libpng-1.1.0. About 160 loops will be turned around |
| 107 | in libpng-1.1.Nn, for testing. |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 108 | |
Glenn Randers-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 109 | 10. July 4, 1998 -- ENHANCEMENT -- Glenn R-P |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 110 | |
Glenn Randers-Pehrson | bcfd15d | 1999-10-01 14:22:25 -0500 | [diff] [blame] | 111 | libpng-1.0.5 and earlier transform colors to gamma=1.0 space for |
Glenn Randers-Pehrson | 5c6aeb2 | 1998-12-29 11:47:59 -0600 | [diff] [blame] | 112 | 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-Pehrson | 6942d53 | 2000-05-01 09:31:54 -0500 | [diff] [blame] | 121 | 11. September 1999 -- ENHANCEMENT -- |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 122 | |
| 123 | It should be possible to use libpng without floating-point aritmetic. |
| 124 | |
| 125 | STATUS: Under investigation, implementation postponed until after |
Glenn Randers-Pehrson | 81fdf8a | 2000-04-07 10:34:56 -0500 | [diff] [blame] | 126 | libpng-1.0.6. The application interface will change because replacements |
Glenn Randers-Pehrson | 4393a9a | 1999-09-17 12:27:26 -0500 | [diff] [blame] | 127 | for the png_set_gAMA(), png_set_cHRM(), and corresponding png_get_() |
| 128 | functions will be needed. |
Glenn Randers-Pehrson | 896239b | 1998-04-21 15:03:57 -0500 | [diff] [blame] | 129 | |
Glenn Randers-Pehrson | 68ea243 | 2000-04-01 21:10:05 -0600 | [diff] [blame] | 130 | Much of this was completed in libpng-1.0.6, but gamma compensation |
Glenn Randers-Pehrson | 61c32d9 | 2000-02-04 23:40:16 -0600 | [diff] [blame] | 131 | is not yet done in fixed-point arithmetic. |
| 132 | |