pngwutil.c


Log

Author Commit Date CI Message
Cosmin Truta 27e548af 2024-01-23T21:25:03 chore: Clean up the return statements and update example.c accordingly
Cosmin Truta 689e0651 2022-11-20T17:51:33 Clean up vestigial uses of png_size_tp
Cosmin Truta 85acd919 2018-12-01T09:36:00 [master] Imported from libpng-1.6.36.tar
Cosmin Truta ceb32778 2018-08-18T22:47:16 Remove top-level const from function-scope variables As per the const correctness rules, top-level const-ness of data in automatic scopes does not propagate outside of these scopes (unlike const-ness at lower levels, such as pointers to const data). Previously, const was used liberally, but inconsistently across the libpng codebase. Using const wherever applicable is not incorrect. However, _consistent_ use of const is difficult to maintain in such conditions. In conclusion, we shall continue to use const only where doing so is strictly necessary: 1. If a function guarantees that it will not modify an argument passed by pointer, the corresponding function parameter should be a pointer-to-const (const T *). 2. Static data should not be modified, therefore it should be const. Reference: Google C++ Style Guide https://google.github.io/styleguide/cppguide.html#Use_of_const
Cosmin Truta 1ef88828 2018-08-18T21:01:02 Replace the remaining uses of PNG_CONST with const In v1.6.0, compiler support for const became a requirement. It should be used consistently. To maintain backwards compatibility, PNG_CONST is still maintained in deprecated form.
Cosmin Truta a8738932 2018-07-28T18:47:21 Remove the "last changed" version information from source comments This information is maintained by the version control system.
Cosmin Truta 8da39742 2018-07-15T23:58:00 [master] Imported from libpng-1.6.35.tar
Cosmin Truta 46aedd89 2018-07-15T23:58:00 Release libpng version 1.6.35
Cosmin Truta a74aa9a0 2018-06-17T22:37:44 [libpng16] Replace the remaining uses of png_size_t with size_t In v1.6.0, size_t became a required type. It should be used consistently. To maintain backwards compatibility, png_size_t is still maintained in deprecated form.
Glenn Randers-Pehrson 58720d3c 2017-08-29T12:23:18 [libpng16] Fix "last changed" dates
Glenn Randers-Pehrson f6ca33d4 2017-08-25T18:52:39 [libpng16] Bump version to 1.6.33beta01
Glenn Randers-Pehrson f8110669 2017-08-24T14:44:52 [master] Imported from libpng-1.6.32.tar
Glenn Randers-Pehrson df7e9dae 2017-08-24T14:44:52 [libpng16] Imported from libpng-1.6.32.tar
Glenn Randers-Pehrson 3524b0d2 2017-07-31T17:03:17 [libpng16] Update "Last changed" dates and some copyright years
Glenn Randers-Pehrson 40afb685 2017-07-31T14:20:40 [libpng16] Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf() in pngwrite.c, and made various other fixes to png_write_eXIf(). Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif to arguments for png_get_eXIf() and png_set_eXIf().
Glenn Randers-Pehrson fbff8986 2017-07-27T05:25:33 [master] Imported from libpng-1.6.31.tar
Glenn Randers-Pehrson 68cb0aae 2017-07-13T11:19:53 [libpng16] Implement eXIf chunk support
Glenn Randers-Pehrson 8c552ddf 2017-06-28T13:46:04 [master] Imported from libpng-1.6.30.tar
Glenn Randers-Pehrson 5aaf6e88 2017-06-06T19:21:23 [libpng16] Imported from libpng-1.6.30beta04.tar
Glenn Randers-Pehrson c5483289 2017-06-06T18:40:45 [libpng16] Avoid writing an empty IDAT when the last IDAT exactly fills the compression buffer (bug report by Brian Baird). This bug was introduced in libpng-1.6.0.
Glenn Randers-Pehrson b363e01e 2017-03-16T07:21:03 [master] Imported from libpng-1.6.29.tar
Glenn Randers-Pehrson f604c74a 2017-01-20T14:46:21 [libpng16] Avoid conditional directives that break statements in pngrutil.c (Romero Malaquias)
Romero B. de S. Malaquias c3f4e5fb 2017-01-20T16:31:54 Avoiding conditional directives that break statements
Glenn Randers-Pehrson 35cbe764 2016-10-19T19:07:25 [master] Imported from libpng-1.6.26.tar
Glenn Randers-Pehrson 0c440812 2016-10-19T19:07:25 [libpng16] Imported from libpng-1.6.26.tar
Glenn Randers-Pehrson 565a751c 2016-10-02T20:16:36 [libpng16] Quieted (bogus?) clang warnings about "absolute value has no effect".
Glenn Randers-Pehrson 761d8333 2016-10-02T18:46:35 [libpng16] Quieted all remaining -Wconversion compiler warnings
Glenn Randers-Pehrson ad3318dd 2016-10-01T19:40:18 [libpng16] Bump version to 1.6.26beta03
Glenn Randers-Pehrson 1b363fa6 2016-09-30T17:19:12 [libpng16] Quieted 116 (out of 288) -Wconversion compiler warnings by changing flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes in png.c, pngread.c, and pngwutil.c.
Glenn Randers-Pehrson 217546ae 2016-09-26T07:54:04 [libpng16] Imported from libpng-1.6.26beta01.tar
Glenn Randers-Pehrson 0c29ab2b 2016-08-03T21:16:26 [master] Imported from libpng-1.6.24.tar
Glenn Randers-Pehrson b50d5cea 2016-08-03T21:16:26 [libpng16] Imported from libpng-1.6.24.tar
Glenn Randers-Pehrson dd70604c 2016-07-15T11:20:46 [libpng16] Fixed more indentation
Glenn Randers-Pehrson 5d7c7d51 2016-07-13T14:45:10 [libpng16] Fixed a harmless typo in pngwutil.c
Glenn Randers-Pehrson f7d54198 2016-07-08T10:09:25 [libpng16] Avoid filter-selection heuristic sum calculations in cases where only one filter is a candidate for selection. This trades off code size (added png_setup_*_row_only() functions) for speed.
Glenn Randers-Pehrson d9779744 2016-06-29T21:52:53 [libpng16] Optimized absolute value calculation in filter selection, similar to code in the PAETH decoder in pngrutil.c. Build with PNG_USE_ABS to use this.
Glenn Randers-Pehrson 3f2879bf 2016-06-23T11:18:32 [libpng16] Imported from libpng-1.6.24beta02.tar
Glenn Randers-Pehrson 4b4a9583 2016-06-23T10:58:24 [libpng16] Imported from libpng-1.6.24beta02.tar
John Bowler 1df0ace0 2016-06-22T17:35:49 Fix MSVC Level 2 warning MSVC doesn't like '-(unsigned)', so replace it by 0U-(unsigned) (in 1.6). Signed-off-by: John Bowler <jbowler@acm.org>
Glenn Randers-Pehrson 147dc568 2016-06-19T22:20:52 [libpng16] Backed out previous optimization; the compiler should handle that.
Glenn Randers-Pehrson 29135161 2016-06-19T18:43:35 [libpng16] Avoid filter-selection heuristic sum calculations in cases where only one filter is a candidate for selection. This trades off code size (added png_setup_*_row_only() functions) for speed.
John Bowler 9c04f57c 2016-06-19T18:01:33 [libpng15] Corrected filter heuristic overflow handling.
Glenn Randers-Pehrson 87c14c52 2016-05-25T22:41:46 [master] Imported from libpng-1.6.22.tar
Glenn Randers-Pehrson ac43a878 2016-05-25T22:41:46 [libpng16] Imported from libpng-1.6.22.tar
Glenn Randers-Pehrson 1a3fa1e0 2016-03-09T07:40:32 [libpng16] Imported from libpng-1.6.22beta03.tar
Glenn Randers-Pehrson baf301d1 2016-02-13T12:01:35 [libpng16] Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that were accidentally removed from libpng-1.6.17.
Glenn Randers-Pehrson 5031c77d 2016-01-16T07:14:12 [libpng16] Bump version to 1.6.22beta01
Glenn Randers-Pehrson 5756fcab 2016-01-15T09:52:13 [master] Imported from libpng-1.6.21.tar
Glenn Randers-Pehrson fc0786a4 2016-01-15T09:52:13 [libpng16] Imported from libpng-1.6.21.tar
Glenn Randers-Pehrson 66db757d 2016-01-02T13:40:27 [libpng16] Happy 2016! Updated copyright year
Glenn Randers-Pehrson 975cbbb0 2015-12-13T15:04:18 [libpng16] Moved png_check_keyword() from pngwutil.c to pngset.c
Glenn Randers-Pehrson 04773749 2015-12-02T19:50:48 [master] Imported from libpng-1.6.20.tar
Glenn Randers-Pehrson 92ec30a3 2015-11-24T07:34:37 [libpng16] Imported from libpng-1.6.20beta03.tar
Glenn Randers-Pehrson b9c62013 2015-11-12T07:00:12 [master] Imported from libpng-1.6.19.tar
Glenn Randers-Pehrson 415d2680 2015-11-12T07:00:12 [libpng16] Imported from libpng-1.6.19.tar
Glenn Randers-Pehrson a901eb3c 2015-10-30T07:57:49 [libpng16] Prevent reading over-length PLTE chunk (Cosmin Truta).
Glenn Randers-Pehrson 81f44665 2015-10-29T09:26:41 [libpng16] Reject attempt to write over-length PLTE chunk
Glenn Randers-Pehrson a8242fe6 2015-08-17T20:46:27 [libng16] Reverted recent mistaken change of 0xnnnn to 0xnnnnUL
Glenn Randers-Pehrson d8b93c29 2015-08-17T10:56:17 [libpng16] Appended more "UL" to hex constants.
Glenn Randers-Pehrson 8ba4b13c 2015-08-16T22:49:58 [libpng16] Changed 0xnnnn constants to 0xnnnnUL.
Glenn Randers-Pehrson 8b83ff37 2015-08-13T20:57:18 [libpng16] Change "n bit" to "n-bit" in comments.
Glenn Randers-Pehrson e1b505cd 2015-07-29T07:42:19 [libpng16]Suppressed a warning from the Borland C++ 5.5.1/5.82 compiler
Glenn Randers-Pehrson 287fb892 2015-07-22T22:36:43 [master] Imported from libpng-1.6.18.tar
Glenn Randers-Pehrson e6172809 2015-07-22T22:36:43 [libpng16] Imported from libpng-1.6.18.tar
John Bowler 7023d871 2015-06-03T15:04:03 [libpng16] Fix g++ build breaks
John Bowler 2dfcf659 2015-06-03T14:58:18 [libpng16] Fixed NO_WRITE_FILTER and -Wconversion build breaks (John Bowler).
John Bowler b780eba4 2015-06-03T14:46:34 [libpng16] Fixed cexcept.h in which GCC 5 now reports that one of the auto variables in the Try macro needs to be volatile to prevent value being lost over the setjmp.
Glenn Randers-Pehrson 89edbf83 2015-05-31T22:40:36 [libpng16] Removed WRITE_WEIGHTED_FILTERED code, to save a few kbytes of the compiled library size. It never worked properly and as far as we can tell, no one uses it. The png_set_filter_heuristics() and png_set_filter_heuristics_fixed() APIs are retained but deprecated and do nothing.
Glenn Randers-Pehrson 1088f492 2015-05-30T22:58:54 [libpng16] Fixed old cut&paste bug in the weighted filter selection code in pngwutil.c, introduced in libpng-0.95, March 1997.
Glenn Randers-Pehrson e6877671 2015-05-30T11:54:45 [libpng16] Backported filter selection code from libpng-1.7.0beta51, to combine sub_row, up_row, avg_row, and paeth_row into try_row and tst_row.
John Bowler 8ee821e6 2015-05-06T20:03:14 [libpng16] PNG_RELEASE_BUILD replaces tests where the code depended on the build base type and can be defined on the command line, allowing testing in beta builds. Back ported from libpng17.
Glenn Randers-Pehrson 2b667e49 2015-03-26T08:06:25 [master] Imported from libpng-1.6.17.tar
Glenn Randers-Pehrson c98f7fb4 2015-03-26T08:06:25 [libpng16] Imported from libpng-1.6.17.tar
Glenn Randers-Pehrson c5370ede 2015-03-21T11:54:32 [libpng16] Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes the Coverity scan without them.
John Bowler c9fd075c 2015-03-16T16:31:13 [libpng16] Fix bug in calculation of maxbits, in png_write_sBIT, introduced in libpng-1.6.17beta01 (John Bowler).
Glenn Randers-Pehrson 7011a8ce 2015-02-27T18:53:44 [libpng16] Added "& 0xff" to things being typecast to "png_byte".
Glenn Randers-Pehrson 6ef579df 2015-01-27T07:02:46 [libpng16] Imported from libpng-1.6.17beta01.tar
Glenn Randers-Pehrson da7a1e79 2014-11-20T09:33:25 [master] Imported from libpng-1.6.15.tar
Glenn Randers-Pehrson e8ef689c 2014-11-20T09:33:25 [libpng16] Imported from libpng-1.6.15.tar
Glenn Randers-Pehrson cda68df8 2014-11-06T22:11:39 [libpng16] Changed "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */"
Glenn Randers-Pehrson b963feee 2014-11-01T13:18:36 [libpng16] More cosmetic changes
Glenn Randers-Pehrson 5d713fe1 2014-10-31T20:48:55 [libpng16] Changed remaining "if (!x)" to "if (x == 0)" and "if (x)" to "if (x !== 0)"
Glenn Randers-Pehrson eed640db 2014-10-22T19:28:06 [master] Imported from libpng-1.6.14.tar
Glenn Randers-Pehrson edb772fd 2014-10-22T19:28:06 [libpng16] Imported from libpng-1.6.14.tar
Glenn Randers-Pehrson 91e3a7d7 2014-10-03T17:16:00 [libpng16] Edited some comments in pngwutil.c
Glenn Randers-Pehrson cb4823d9 2014-10-03T17:14:39 [libpng16] Conditionally compile some code in png_deflate_claim(), when PNG_WARNINGS_SUPPORTED and PNG_ERROR_TEXT_SUPPORTED are disabled.
Glenn Randers-Pehrson d752225d 2014-10-03T17:00:38 [libpng16] Removed "text_len" parameter from private function png_write_zTXt() since it is unused.
Glenn Randers-Pehrson d55c4f32 2014-08-21T05:53:38 [master] Imported from libpng-1.6.13.tar
Glenn Randers-Pehrson 212fd574 2014-06-11T21:10:16 [libpng16] Bump version to 1.6.13beta01
Glenn Randers-Pehrson 238e7646 2014-06-11T20:35:18 [master] Imported from libpng-1.6.12.tar
Glenn Randers-Pehrson e429c66c 2014-06-11T20:35:18 [libpng16] Imported from libpng-1.6.12.tar
Glenn Randers-Pehrson da7b692c 2014-06-06T11:42:50 [libpng16] Bump version to 1.6.12beta01
Glenn Randers-Pehrson d21eae44 2014-06-05T09:53:19 [master] Imported from libpng-1.6.11.tar
Glenn Randers-Pehrson c4e0f3de 2014-06-05T09:53:19 [libpng16] Imported from libpng-1.6.11.tar
Glenn Randers-Pehrson ab9736a6 2014-04-25T06:14:50 [libpng16] Allow writing ICC V2 profiles that lack padding (Kai-Uwe Behrmann).
Glenn Randers-Pehrson 05670156 2014-03-08T12:39:52 [libpng16] Use "if (value != 0)" instead of "if (value)" consistently.
Glenn Randers-Pehrson 1cc02f03 2014-03-06T12:35:04 [master] Imported from libpng-1.6.10.tar
Glenn Randers-Pehrson 24afd07a 2014-03-05T16:55:19 [libpng16] Changed blank to newline in three function declarations.
Glenn Randers-Pehrson a4f7ea0d 2013-04-25T07:24:46 [master] Imported from libpng-1.6.2.tar
Glenn Randers-Pehrson 399430da 2013-04-25T09:52:00 [libpng16] Update "last changed" comments.