Commit Graph

527 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
0c440812db [libpng16] Imported from libpng-1.6.26.tar 2016-10-19 19:11:38 -05:00
Glenn Randers-Pehrson
13bdd8bcdf [libpng16] Imported from libpng-1.6.26beta05.tar 2016-10-05 19:43:35 -05:00
Glenn Randers-Pehrson
761d833372 [libpng16] Quieted all remaining -Wconversion compiler warnings 2016-10-02 18:46:35 -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
ad3318ddc8 [libpng16] Bump version to 1.6.26beta03 2016-10-01 19:44:42 -05:00
Glenn Randers-Pehrson
fbe3e002bc Merge branch 'libpng16' of git://github.com/jbowler/libpng into libpng16 2016-09-30 21:51:27 -05:00
Glenn Randers-Pehrson
b5b77a72b4 Revert "[libpng16] Quieted about 100 warnings from clang-3.8 in pngtrans.c, pngread.c,"
This reverts commit 97dfccb632.
2016-09-30 21:34:21 -05:00
Glenn Randers-Pehrson
97dfccb632 [libpng16] Quieted about 100 warnings from clang-3.8 in pngtrans.c, pngread.c,
pngwrite.c, pngunknown.c, and pngvalid.c.  Several warnings still remain
in pngvalid.c
2016-09-30 21:02:03 -05:00
John Bowler
319c9852bf Unsigned overflow
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>
2016-09-30 18:37:22 -07:00
Glenn Randers-Pehrson
1b363fa6b0 [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.
2016-09-30 17:19:12 -05:00
Glenn Randers-Pehrson
bc2bb96cd7 [libpng16] Conditionally compile png_set_benign_errors() in pngread.c 2016-09-11 19:22:28 -05: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
51df269afe [libpng16] Imported from libpng-1.6.24beta01.tar 2016-06-11 18:07:22 -05:00
John Bowler
5c6b7e177c [libpng16] Avoid potential overflow of the PNG_IMAGE_SIZE macro. This macro
is not used within libpng, but is used in some of the examples.
2016-06-11 14:11:09 -05:00
Glenn Randers-Pehrson
ed6db9d86b [libpng16] Imported from libpng-1.6.23.tar 2016-06-09 06:49:42 -05:00
John Bowler
81f0273d54 [libpng16] Added tests in pngvalid.c to check zero-length IDAT chunks in various
positions.  Fixed the sequential reader to handle these more robustly
(John Bowler).
2016-05-29 09:45:33 -05:00
Krishnaraj Bhat
46c47291e8 gcc6: fix misleading indentation warning
Although not a bug in this case, but shows up when -Wall is used
2016-03-07 13:56:15 +05:30
John Bowler
175a126a1a Simplified API: write-to-memory, overflow handling
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>
2016-01-18 09:53:38 -08:00
Glenn Randers-Pehrson
4d8de33979 [libpng16] Update copyright uears in source files. 2015-12-13 22:41:17 -06:00
Viktor Szakats
4db6127658 pngread: avoid clang warning for unreachable code
```
pngread.c:2841:10: warning: 'break' will never be executed [-Wunreachable-code-break]
         break;
         ^~~~~
```
2015-11-19 19:54:01 +01:00
Glenn Randers-Pehrson
01a0e8062d [libpng16] Reverted addition of png_set_filler_16 and png_set_add_alpha_16()
functions. They unnecessarily duplicate png_set_filler() and png_set_add_alpha()
which now work properly with 16-bit images.
2015-09-24 22:39:53 -05:00
Glenn Randers-Pehrson
efe4e5d10d [libpng16] Reverted the fix of byte order in png_do_read_filler() with 16-bit
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.
2015-09-23 22:08:04 -05:00
Glenn Randers-Pehrson
a8242fe6fb [libng16] Reverted recent mistaken change of 0xnnnn to 0xnnnnUL 2015-08-17 20:46:27 -05:00
John Bowler
751cee5ef1 [libpng16] Added signed/unsigned 16-bit safety net. This removes the dubious
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).
2015-08-16 22:54:21 -05:00
Glenn Randers-Pehrson
8ba4b13c55 [libpng16] Changed 0xnnnn constants to 0xnnnnUL. 2015-08-16 22:49:58 -05:00
Glenn Randers-Pehrson
fd8ef4c428 [libpng16] Add #ifdef PNG_DEBUG/#endif around normally unreachable code
in pngread.c
2015-08-07 14:43:34 -05:00
Victor Szakats
4e1d299e6b [libpng16] Removed unreachable "break" statements in png.c, pngread.c, and
pngrtran.c to suppress clang warnings (Bug report by Viktor Szakats).
2015-08-07 14:31:11 -05:00
Glenn Randers-Pehrson
9d4ea3014b [libpng16] Imported from libpng-1.6.18beta08.tar 2015-06-30 10:54:44 -05:00
Glenn Randers-Pehrson
f86720c6c0 [libpng16] Fix some indentation. 2015-06-11 22:00:14 -05:00
John Bowler
8ee821e69a [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.
2015-05-06 20:03:14 -05:00
Glenn Randers-Pehrson
c98f7fb4e3 [libpng16] Imported from libpng-1.6.17.tar 2015-03-26 08:11:12 -05:00
John Bowler
6eecfe3886 [libpng16] Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha
value was wrong.  It's not clear if this affected the final stored
value; in the obvious code path the upper and lower 8-bits of the
alpha value were identical and the alpha was truncated to 8-bits
rather than dividing by 257 (John Bowler).
2015-03-22 19:42:14 -05:00
Glenn Randers-Pehrson
c5370ede95 [libpng16] Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes
the Coverity scan without them.
2015-03-21 11:54:32 -05:00
Glenn Randers-Pehrson
7011a8cec3 [libpng16] Added "& 0xff" to things being typecast to "png_byte". 2015-02-27 18:53:44 -06:00
Glenn Randers-Pehrson
8cd78da8b3 [libpng16] Do not build png_product2() when it is unused.
Work around more Coverity-scan dead-code warnings.
2015-02-07 09:03:30 -06:00
Glenn Randers-Pehrson
6ef579df50 [libpng16] Imported from libpng-1.6.17beta01.tar 2015-01-28 19:15:16 -06:00
Glenn Randers-Pehrson
e8ef689cb9 [libpng16] Imported from libpng-1.6.15.tar 2014-11-20 10:22:57 -06:00
Glenn Randers-Pehrson
cda68df8c1 [libpng16] Changed "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */" 2014-11-06 22:11:39 -06:00
John Bowler
03df189954 [libpng16] Fixed array size calculations to avoid warnings. At various points
in the code the number of elements in an array is calculated using
sizeof.  This generates a compile time constant of type (size_t) which
is then typically assigned to an (unsigned int) or (int). Some versions
of GCC on 64-bit systems warn about the apparent narrowing, even though
the same compiler does apparently generate the correct, in-range,
numeric constant.  This adds appropriate, safe, casts to make the
warnings go away.
2014-11-05 17:19:36 -06:00
Glenn Randers-Pehrson
b963feeec6 [libpng16] More cosmetic changes 2014-11-01 13:18:36 -05:00
Glenn Randers-Pehrson
5d713fe123 [libpng16] Changed remaining "if (!x)" to "if (x == 0)" and "if (x)" to
"if (x !== 0)"
2014-10-31 20:58:40 -05:00
Glenn Randers-Pehrson
c6a8cb7d10 [libpng16] Added missing "ptr = NULL" after some instances of png_free(). 2014-10-29 08:27:34 -05:00
Glenn Randers-Pehrson
a11cd84160 [libpng16] Only mark text chunks as written after successfully writing them. 2014-10-05 13:45:38 -05:00
Glenn Randers-Pehrson
a243ec06b0 [libpng16] Imported from libpng-1.6.13beta03.tar 2014-08-02 21:28:14 -05:00
Glenn Randers-Pehrson
3efbecab92 [libpng16] Imported from libpng-1.6.13beta02.tar 2014-07-21 17:21:21 -05:00
Glenn Randers-Pehrson
212fd5745d [libpng16] Bump version to 1.6.13beta01 2014-06-11 21:13:33 -05:00
Glenn Randers-Pehrson
e429c66cea [libpng16] Imported from libpng-1.6.12.tar 2014-06-11 20:41:51 -05:00
Glenn Randers-Pehrson
da7b692ce0 [libpng16] Bump version to 1.6.12beta01 2014-06-06 11:57:30 -05:00