summaryrefslogtreecommitdiff
path: root/pngread.c
Commit message (Collapse)AuthorAgeFilesLines
* Clean up comments and whitespace characters in source filesCosmin Truta2022-11-201-2/+2
| | | | | | | Remove all remaining "last changed" version info from source comments. (The version control system maintains this information automatically.) Delete the trailing whitespace characters.
* Fix an instance of -Wunused-but-set-variable.Peter Kasting2022-09-131-3/+0
| | | | Bug: chromium:1203071
* Fix a memory leak in the riffled palette optimization on ARM; refactorCosmin Truta2019-02-031-1/+7
| | | | | | | | | | | | | | | | | | | | Move deallocation of riffled_palette from png_write_destroy to png_read_destroy. The reader (not the writer) is the owner of riffled_palette. Move allocation and initialization of riffled_palette from png_do_read_transformations to png_init_palette_transformations. Allow riffled_palette inside png_struct only if the ARM Neon optimizations are enabled. Rename png_riffle_palette_rgba to png_riffle_palette_rgba8, etc., to better indicate the strict applicability of these routines. Fix an unused parameter warning in the build configurations where riffled palette optimization is not enabled. Fix indentation.
* Remove top-level const from function-scope variablesCosmin Truta2018-08-181-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Replace the remaining uses of PNG_CONST with constCosmin Truta2018-08-181-2/+2
| | | | | | 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.
* Remove the "last changed" version information from source commentsCosmin Truta2018-07-281-3/+3
| | | | This information is maintained by the version control system.
* Release libpng version 1.6.35Cosmin Truta2018-07-151-2/+2
|
* [libpng16] Replace the remaining uses of png_size_t with size_tCosmin Truta2018-06-171-3/+3
| | | | | | 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.
* Misc. typosUnknown2017-11-031-1/+1
| | | Some are user facing. Some are in actual code. Most are in source comments. Also, please double check the changes in contrib/tools/pngfix.c
* [libpng16] Imported from libpng-1.6.33.tarv1.6.33Glenn Randers-Pehrson2017-09-281-1/+1
|
* [libpng16] Add support for loading images with associated alpha in theGlenn Randers-Pehrson2017-09-231-1/+1
| | | | Simplified API (Samuel Williams).
* Add support for loading images with associated alpha.Samuel Williams2017-09-061-1/+11
|
* [libpng16] Fix "last changed" datesGlenn Randers-Pehrson2017-08-291-1/+1
|
* [libpng16] Bump version to 1.6.33beta01Glenn Randers-Pehrson2017-08-251-1/+1
|
* [libpng16] Imported from libpng-1.6.32.tarv1.6.32Glenn Randers-Pehrson2017-08-241-1/+1
|
* [libpng16] Imported from libpng-1.6.32beta11.tarv1.6.32beta11Glenn Randers-Pehrson2017-08-071-0/+1
|
* [libpng16] Update "Last changed" dates and some copyright yearsGlenn Randers-Pehrson2017-07-311-1/+1
|
* [libpng16] Updated pngread.c with calls to png_handle_eXIf() omitted from ↵Glenn Randers-Pehrson2017-07-311-0/+10
| | | | previous checkin
* [libpng16] Imported from libpng-1.6.31.tarv1.6.31libpng-1.6.31-signedlibpng-1.6.31-master-signedGlenn Randers-Pehrson2017-07-271-1/+1
|
* [libpng16] Removed one of the GCC-7.1.0 'strict-overflow' warnings thatJohn Bowler2017-07-111-7/+8
| | | | | | | | | | | | result when integers appear on both sides of a compare. Worked around the others by forcing the strict-overflow setting in the relevant functions to a level where they are not reported. Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like the space. Worked around some C-style casts from (void*) because g++ 5.4.0 objects to them. Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint overflow' check that is on by default with -Wall -Wextra.
* [libpng16] Imported from libpng-1.6.26.tarv1.6.26libpng-1.6.26-signedGlenn Randers-Pehrson2016-10-191-1/+1
|
* [libpng16] Imported from libpng-1.6.26beta05.tarv1.6.26beta05Glenn Randers-Pehrson2016-10-051-2/+2
|
* [libpng16] Quieted all remaining -Wconversion compiler warningsGlenn Randers-Pehrson2016-10-021-10/+11
|
* [libpng16] Quieted 45 (out of 86 remaining) -Wconversion compiler warningsGlenn Randers-Pehrson2016-10-021-12/+12
|
* [libpng16] Bump version to 1.6.26beta03Glenn Randers-Pehrson2016-10-011-1/+1
|
* Merge branch 'libpng16' of git://github.com/jbowler/libpng into libpng16Glenn Randers-Pehrson2016-09-301-2/+2
|\
| * Unsigned overflowJohn Bowler2016-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all currently detected cases of unsigned overflow. Detection is runtime, so test case dependent. The changes to pngvalid.c eliminate spurious and probably invalid tests with one while loop exception. Apart from that and the change to the dependence on the intended unsigned overflow in pngtrans.c the changes are limited to altering the meme for an unsigned 'x' from: while (x-- > 0) to for (; x > 0; --x) This works because, in all cases, the control variable is not used in the loop. The 'while' meme was, at one time, warn'ed by GCC so it is probably a good change, for some weird religious value of good. Signed-off-by: John Bowler <jbowler@acm.org>
* | Revert "[libpng16] Quieted about 100 warnings from clang-3.8 in pngtrans.c, ↵Glenn Randers-Pehrson2016-09-301-4/+4
| | | | | | | | | | | | pngread.c," This reverts commit 97dfccb6325e54d45c4440b6dd037619d88688cc.
* | [libpng16] Quieted about 100 warnings from clang-3.8 in pngtrans.c, pngread.c,Glenn Randers-Pehrson2016-09-301-4/+4
| | | | | | | | | | pngwrite.c, pngunknown.c, and pngvalid.c. Several warnings still remain in pngvalid.c
* | [libpng16] Quieted 116 (out of 288) -Wconversion compiler warnings by changingGlenn Randers-Pehrson2016-09-301-4/+4
|/ | | | | flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes in png.c, pngread.c, and pngwutil.c.
* [libpng16] Conditionally compile png_set_benign_errors() in pngread.cGlenn Randers-Pehrson2016-09-111-0/+2
|
* [libpng16] Imported from libpng-1.6.24.tarv1.6.24libpng-1.6.24-signedGlenn Randers-Pehrson2016-08-031-1/+1
|
* [libpng16] Fixed more indentationGlenn Randers-Pehrson2016-07-151-109/+108
|
* [libpng16] Fixed some indentation to comply with our coding style.Glenn Randers-Pehrson2016-07-131-3/+3
|
* [libpng16] Imported from libpng-1.6.24beta01.tarv1.6.24beta01Glenn Randers-Pehrson2016-06-111-1/+1
|
* [libpng16] Avoid potential overflow of the PNG_IMAGE_SIZE macro. This macroJohn Bowler2016-06-111-1/+24
| | | | is not used within libpng, but is used in some of the examples.
* [libpng16] Imported from libpng-1.6.23.tarv1.6.23libpng-1.6.23-signedGlenn Randers-Pehrson2016-06-091-1/+1
|
* [libpng16] Added tests in pngvalid.c to check zero-length IDAT chunks in variousJohn Bowler2016-05-291-8/+18
| | | | | positions. Fixed the sequential reader to handle these more robustly (John Bowler).
* gcc6: fix misleading indentation warningKrishnaraj Bhat2016-03-071-14/+14
| | | | Although not a bug in this case, but shows up when -Wall is used
* Simplified API: write-to-memory, overflow handlingJohn Bowler2016-01-181-36/+62
| | | | | | | | | | | | | | This implements an API and provides a number of assist macros to allow an application which uses the simplified API write to bypass stdio and write directly to memory. It also includes some warnings (png.h) and some check code to detect *possible* overflow in the ROW_STRIDE and simplified image SIZE macros. This disallows image width/height/format that *might* overflow. A quiet API change that limits in-memory image size (uncompressed) to less that 4GByte and image row size (stride) to less than 2GByte. Signed-off-by: John Bowler <jbowler@acm.org>
* [libpng16] Update copyright uears in source files.Glenn Randers-Pehrson2015-12-131-1/+1
|
* pngread: avoid clang warning for unreachable codeViktor Szakats2015-11-191-1/+0
| | | | | | | | ``` pngread.c:2841:10: warning: 'break' will never be executed [-Wunreachable-code-break] break; ^~~~~ ```
* [libpng16] Reverted addition of png_set_filler_16 and png_set_add_alpha_16()Glenn Randers-Pehrson2015-09-241-1/+1
| | | | | functions. They unnecessarily duplicate png_set_filler() and png_set_add_alpha() which now work properly with 16-bit images.
* [libpng16] Reverted the fix of byte order in png_do_read_filler() with 16-bitGlenn Randers-Pehrson2015-09-231-1/+1
| | | | | | | input that was made in version 1.6.17beta01, to preserve legacy behavior even though it was incorrect. Instead, added new API png_set_filter_16() and png_set_add_alpha_16() that set a flag to make png_do_read_filter() interpret the filler bytes properly.
* [libng16] Reverted recent mistaken change of 0xnnnn to 0xnnnnULGlenn Randers-Pehrson2015-08-171-2/+2
|
* [libpng16] Added signed/unsigned 16-bit safety net. This removes the dubiousJohn Bowler2015-08-161-3/+3
| | | | | | | | | 0x8000 flag definitions on 16-bit systems. They aren't supported yet the defs *probably* work, however it seems much safer to do this and be advised if anyone, contrary to advice, is building libpng 1.6 on a 16-bit system. It also adds back various switch default clauses for GCC; GCC errors out if they are not present (with an appropriately high level of warnings).
* [libpng16] Changed 0xnnnn constants to 0xnnnnUL.Glenn Randers-Pehrson2015-08-161-2/+2
|
* [libpng16] Add #ifdef PNG_DEBUG/#endif around normally unreachable codeGlenn Randers-Pehrson2015-08-071-0/+2
| | | | in pngread.c
* [libpng16] Removed unreachable "break" statements in png.c, pngread.c, andVictor Szakats2015-08-071-9/+10
| | | | pngrtran.c to suppress clang warnings (Bug report by Viktor Szakats).
* [libpng16] Imported from libpng-1.6.18beta08.tarv1.6.18beta08Glenn Randers-Pehrson2015-06-301-3/+3
|