Commit Graph

520 Commits

Author SHA1 Message Date
Cosmin Truta
ceb327789b 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
2018-08-18 22:47:16 -04:00
Cosmin Truta
1ef8882814 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.
2018-08-18 21:01:02 -04:00
Cosmin Truta
a873893279 Remove the "last changed" version information from source comments
This information is maintained by the version control system.
2018-07-28 18:47:21 -04:00
Cosmin Truta
46aedd8961 Release libpng version 1.6.35 2018-07-15 23:58:00 -04:00
Cosmin Truta
a74aa9a002 [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.
2018-06-17 22:37:44 -04:00
Glenn Randers-Pehrson
0e06b5948c [libpng16] Imported from libpng-1.6.35beta01.tar 2018-03-06 14:06:24 -06:00
Glenn Randers-Pehrson
fc32eb1662 [libpng16] Initialize entire 256-entry palette in png_set_PLTE(). 2017-11-04 16:31:45 -05:00
Glenn Randers-Pehrson
2f8b82ebca [libpng16] Revert recent changes that did not help with oss-fuzz issues 2017-10-29 10:30:42 -05:00
Glenn Randers-Pehrson
af08094ba6 [libpng16] Use png_calloc instead of png_malloc in png_set_tRNS 2017-10-19 20:59:40 -05:00
Glenn Randers-Pehrson
9bddba26de [libpng16] Initialize entire palette array to zero in png_handle_PLTE(). 2017-10-17 16:22:22 -05:00
Glenn Randers-Pehrson
3b5bcea010 [libpng16] Revert recent changes to pngset.c 2017-10-17 15:20:31 -05:00
Glenn Randers-Pehrson
adefba1b03 [libpng16] Free tRNS chunk data when abandoning it 2017-10-16 21:03:43 -05:00
Glenn Randers-Pehrson
48a2460393 [libpng16] Do not enable tRNS having trans_color with out-of-range value. 2017-10-16 07:25:58 -05:00
Glenn Randers-Pehrson
2be0f33e7c [libpng16] Nullify trans_color with out-of-range value, to stop oss-fuzz issue. 2017-10-15 11:04:53 -05:00
Glenn Randers-Pehrson
066cb34268 [libpng16] Fix some comments 2017-09-19 15:52:36 -05:00
Glenn Randers-Pehrson
413de0a56a [libpng16] Undo another faulty attempt to stifle oss-fuzz complaint 2017-09-16 08:29:06 -05:00
Glenn Randers-Pehrson
04e16d2817 [libng16] Attempt to stop Use of Uninitialized Value in png_set_text_2() 2017-09-15 16:44:20 -05:00
Glenn Randers-Pehrson
d1a0937cae [libpng16] Still another attempt to fix oss-fuzz uninitialized value 2017-09-15 08:20:23 -05:00
Glenn Randers-Pehrson
4de130c255 [libpng16] Imported from libpng-1.6.33beta03.tar 2017-09-14 12:46:28 -05:00
Glenn Randers-Pehrson
d7edcc40e4 [libpng16] Undo failed attempt to debug UMR in png_set_text_2(). 2017-09-13 19:34:51 -05:00
Glenn Randers-Pehrson
76b269b1f4 [libpng16] Attempt to debug Uninitialized Memory Read in png_set_text_2(),
detected by the oss-fuzz project.
2017-09-12 08:52:44 -05:00
Glenn Randers-Pehrson
0f2adc19eb [libpng16] Trying to avoid a UMR in png_set_text_2((). 2017-09-10 09:47:29 -05:00
Glenn Randers-Pehrson
1aabcfdbae [libpng16] Trying to isolate oss-fuzz issue in png_set_text_2(). 2017-09-10 05:45:44 -05:00
Glenn Randers-Pehrson
3789cba2f2 [libpng16] Attempt to isolate an oss-fuzz issue in png_set_text_2 2017-09-08 09:34:08 -05:00
Glenn Randers-Pehrson
58720d3c06 [libpng16] Fix "last changed" dates 2017-08-29 12:29:03 -05:00
Glenn Randers-Pehrson
f6ca33d42c [libpng16] Bump version to 1.6.33beta01 2017-08-25 18:54:30 -05:00
Glenn Randers-Pehrson
df7e9dae0c [libpng16] Imported from libpng-1.6.32.tar 2017-08-24 16:39:02 -05:00
Glenn Randers-Pehrson
0ec733ce61 [libpng16] Added "eXIf" to "chunks_to_ignore[]" in png_set_keep_unknown_chunks(). 2017-08-05 08:01:53 -05:00
Glenn Randers-Pehrson
d930d36155 [libpng16] Restored png_get_eXIf_1() and png_set_eXIf_1() because strlen(eXIf_buf)
does not work (the eXIf chunk data can contain zeroes).
2017-08-03 10:29:10 -05:00
Glenn Randers-Pehrson
3fa1df48a1 [libpng16] Removed png_get_eXIf_1() and png_set_eXIf_1(). 2017-08-02 17:27:41 -05:00
Glenn Randers-Pehrson
7c709f039f [libpng16] Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability. 2017-08-02 16:48:11 -05:00
Glenn Randers-Pehrson
71a56180e5 [libpng16] Stop memory leak when returning from png_handle_eXIf() with an error
(Bug report from the OSS-fuzz project).
2017-08-01 21:42:16 -05:00
Glenn Randers-Pehrson
3524b0d201 [libpng16] Update "Last changed" dates and some copyright years 2017-07-31 17:03:17 -05:00
Glenn Randers-Pehrson
3e753f5cbe [libpng16] Changed name of png_get_eXIF and png_set_eXIf() to png_get_eXIf_1()
and png_set_eXIf_1(), respectively, to avoid breaking API compatibility
with libpng-1.6.31.
2017-07-31 16:56:30 -05:00
Glenn Randers-Pehrson
40afb68570 [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().
2017-07-31 14:21:46 -05:00
Glenn Randers-Pehrson
68cb0aaee3 [libpng16] Implement eXIf chunk support 2017-07-13 11:22:48 -05:00
Glenn Randers-Pehrson
9f7134c3fc [libpng16] Update some "last changed" dates 2017-06-29 17:52:18 -05:00
Glenn Randers-Pehrson
e744ee1338 [libpng16] Update CHANGES, ANNOUNCE, and "last changed" dates. 2017-03-30 12:24:55 -05:00
Viktor Szakats
8c50acb9d2 silence clang -Wcomma warnings 2017-03-29 23:54:40 +00:00
Glenn Randers-Pehrson
0c440812db [libpng16] Imported from libpng-1.6.26.tar 2016-10-19 19:11:38 -05:00
Glenn Randers-Pehrson
3875d9af4c [libpng16] Quieted 45 (out of 86 remaining) -Wconversion compiler warnings 2016-10-02 17:08:46 -05:00
Glenn Randers-Pehrson
5cb1700702 [libpng16] Update CHANGES and ANNOUNCE and last-changed date in pngset.c 2016-09-03 11:51:29 -05:00
John Bowler
7dc0329250 [libpng16] png_set_pCAL: do not png_error on read
Because png_handle_pCAL has allocated memory to free.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-09-02 19:26:42 -07:00
Glenn Randers-Pehrson
b50d5cea2b [libpng16] Imported from libpng-1.6.24.tar 2016-08-03 21:32:26 -05:00
Glenn Randers-Pehrson
dd70604cec [libpng16] Fixed more indentation 2016-07-15 11:20:46 -05:00
Glenn Randers-Pehrson
192e92d681 [libpng16] Fixed some indentation to comply with our coding style. 2016-07-13 14:43:42 -05:00
Glenn Randers-Pehrson
b733c50bc0 [libpng16] Updated CHANGES and ANNOUNCE 2016-07-01 18:42:07 -05:00
John Bowler
0ac91cc657 pngcp: tool to copy PNG files
This adds pngcp to the build together with a pngcp.dfa configuration test; the
test revealed some configuration bugs which are fixed by corrections to the
_SUPPORTED macros.

pngcp builds on all tested configurations and a number of bugs have been fixed
to make this happen relative to the version in libpng 1.7 contrib/examples.
pngcp.dfa will have to be different for 1.7 but pngcp.c should work fine (not
yet tested).  pngcp itself is still missing a usage message; this is a
preliminary version, although since it behaves the same way as 'cp' most unoids
shouldn't have a problem using it correctly.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:27:43 -07:00
Glenn Randers-Pehrson
ed6db9d86b [libpng16] Imported from libpng-1.6.23.tar 2016-06-09 06:49:42 -05:00
Glenn Randers-Pehrson
6c7459e455 [libpng16] Ensure png_ptr->trans_values is set in png_set_tRNS(). 2016-05-27 20:09:23 -05:00