Skip to content

Commit 1d7f437

Browse files
mdempskyjobor
authored andcommitted
<third_party/libpng> [Backport] Update to libpng 1.2.52 (rollup change only)
Verified that both of the fixes mentioned in README.chromium were fixed in upstream. Upstream used a slightly different approach to detecting whether "prefix_size + expanded_size + 1" overflows in pngrutil.c, but their solution looks okay too. [email protected] BUG=532758 Review URL: https://codereview.chromium.org/1372313004 Change-Id: I719050787bb1b4ce76bc09799c6b9973d379c0db Cr-Commit-Position: refs/heads/master@{#351445} Reviewed-by: Allan Sandfeld Jensen <[email protected]>
1 parent 311071b commit 1d7f437

File tree

16 files changed

+236
-791
lines changed

16 files changed

+236
-791
lines changed

chromium/third_party/libpng/LICENSE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ this sentence.
1010

1111
This code is released under the libpng license.
1212

13-
libpng versions 1.2.6, August 15, 2004, through 1.2.45, July 7, 2011, are
14-
Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
13+
libpng versions 1.2.6, August 15, 2004, through 1.2.52, November 20, 2014, are
14+
Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are
1515
distributed according to the same disclaimer and license as libpng-1.2.5
1616
with the following individual added to the list of Contributing Authors
1717

@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
108108

109109
Glenn Randers-Pehrson
110110
glennrp at users.sourceforge.net
111-
July 7, 2011
111+
November 20, 2014

chromium/third_party/libpng/README

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
README for libpng version 1.2.45 - July 7, 2011 (shared library 12.0)
1+
README for libpng version 1.2.52 - November 20, 2014 (shared library 12.0)
22
See the note about version numbers near the top of png.h
33

44
See INSTALL for instructions on how to install libpng.
@@ -93,6 +93,12 @@ This code is currently being archived at libpng.sf.net in the
9393
at GO GRAPHSUP. If you can't find it in any of those places,
9494
e-mail me, and I'll help you find it.
9595

96+
I am not a lawyer, but I believe that the Export Control Classification
97+
Number (ECCN) for libpng is EAR99, which means not subject to export
98+
controls or International Traffic in Arms Regulations (ITAR) because it
99+
is open source, publicly available software, that does not contain any
100+
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
101+
96102
If you have any code changes, requests, problems, etc., please e-mail
97103
them to me. Also, I'd appreciate any make files or project files,
98104
and any modifications you needed to make to get libpng to compile,
@@ -129,7 +135,7 @@ and ...". If in doubt, send questions to me. I'll bounce them
129135
to others, if necessary.
130136

131137
Please do not send suggestions on how to change PNG. We have
132-
been discussing PNG for twelve years now, and it is official and
138+
been discussing PNG for nineteen years now, and it is official and
133139
finished. If you have suggestions for libpng, however, I'll
134140
gladly listen. Even if your suggestion is not used immediately,
135141
it may be used later.
@@ -174,8 +180,7 @@ Files in this distribution:
174180
gregbook => source code for PNG reading and writing, from
175181
Greg Roelofs' "PNG: The Definitive Guide",
176182
O'Reilly, 1999
177-
msvctest => Builds and runs pngtest using a MSVC workspace
178-
pngminim => Simple pnm2pngm and png2pnmm programs
183+
pngminim => Minimal pnm2pngm and png2pnmm programs
179184
pngminus => Simple pnm2png and png2pnm programs
180185
pngsuite => Test images
181186
visupng => Contains a MSVC workspace for VisualPng
@@ -184,11 +189,14 @@ Files in this distribution:
184189
beos => Contains a Beos workspace for building libpng
185190
c5builder => Contains a Borland workspace for building
186191
libpng and zlib
192+
MacOSX => Contains a MacOSX workspace for building libpng
187193
netware.txt => Contains instructions for downloading a set
188194
of project files for building libpng and
189195
zlib on Netware.
190196
visualc6 => Contains a Microsoft Visual C++ (MSVC)
191197
workspace for building libpng and zlib
198+
visualc71 => Contains a Microsoft Visual C++ (MSVC)
199+
workspace for building libpng and zlib
192200
wince.txt => Contains instructions for downloading a
193201
Microsoft Visual C++ (Windows CD Toolkit)
194202
workspace for building libpng and zlib on
@@ -199,11 +207,11 @@ Files in this distribution:
199207
makefile.std => Generic UNIX makefile (cc, creates static
200208
libpng.a)
201209
makefile.elf => Linux/ELF gcc makefile symbol versioning,
202-
creates libpng12.so.0.1.2.45)
210+
creates libpng12.so.0.1.2.52)
203211
makefile.linux => Linux/ELF makefile (gcc, creates
204-
libpng12.so.0.1.2.45)
212+
libpng12.so.0.1.2.52)
205213
makefile.gcmmx => Linux/ELF makefile (gcc, creates
206-
libpng12.so.0.1.2.45, previously
214+
libpng12.so.0.1.2.52, previously
207215
used assembler code tuned for Intel MMX
208216
platform)
209217
makefile.gcc => Generic makefile (gcc, creates static
@@ -228,12 +236,12 @@ Files in this distribution:
228236
makefile.openbsd => OpenBSD makefile
229237
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
230238
makefile.sggcc => Silicon Graphics
231-
(gcc, creates libpng12.so.0.1.2.45)
239+
(gcc, creates libpng12.so.0.1.2.52)
232240
makefile.sunos => Sun makefile
233241
makefile.solaris => Solaris 2.X makefile
234-
(gcc, creates libpng12.so.0.1.2.45)
242+
(gcc, creates libpng12.so.0.1.2.52)
235243
makefile.so9 => Solaris 9 makefile
236-
(gcc, creates libpng12.so.0.1.2.45)
244+
(gcc, creates libpng12.so.0.1.2.52)
237245
makefile.32sunu => Sun Ultra 32-bit makefile
238246
makefile.64sunu => Sun Ultra 64-bit makefile
239247
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: libpng
22
URL: http://libpng.org/
3-
Version: 1.2.45
3+
Version: 1.2.52
44
Security Critical: yes
55
License: libpng license
66
License Android Compatible: yes
@@ -10,10 +10,8 @@ Our custom configuration options are defined in pngusr.h. This was previously
1010
called mozpngconf.h, which was copied from Mozilla and modified by Apple (hence
1111
the wk_* names).
1212

13-
Updated to 1.2.45, no changes to the source files but all unneeded files
13+
Updated to 1.2.52, no changes to the source files but all unneeded files
1414
stripped.
1515

16-
- One custom patch for bug 112822, to be sent upstream.
17-
- Also a signedness condition from upstream relating to the above, bug 116162.
1816
- Unset PNG_NO_READ_PACK on Android in pngusr.h, required by freetype to support
1917
color glyphs.

chromium/third_party/libpng/png.c

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
/* png.c - location for general purpose libpng functions
33
*
4-
* Last changed in libpng 1.2.43 [February 25, 2010]
5-
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
4+
* Last changed in libpng 1.2.51 [February 6, 2014]
5+
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
66
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
77
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
88
*
@@ -17,7 +17,7 @@
1717
#include "png.h"
1818

1919
/* Generate a compiler error if there is an old png.h in the search path. */
20-
typedef version_1_2_45 Your_png_h_is_not_version_1_2_45;
20+
typedef version_1_2_52 Your_png_h_is_not_version_1_2_52;
2121

2222
/* Version information for C files. This had better match the version
2323
* string defined in png.h.
@@ -718,20 +718,20 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
718718
png_charp PNGAPI
719719
png_get_copyright(png_structp png_ptr)
720720
{
721-
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
721+
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
722722
#ifdef PNG_STRING_COPYRIGHT
723723
return PNG_STRING_COPYRIGHT
724724
#else
725725
#ifdef __STDC__
726726
return ((png_charp) PNG_STRING_NEWLINE \
727-
"libpng version 1.2.45 - July 7, 2011" PNG_STRING_NEWLINE \
728-
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
727+
"libpng version 1.2.52 - November 20, 2014" PNG_STRING_NEWLINE \
728+
"Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
729729
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
730730
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
731731
PNG_STRING_NEWLINE);
732732
#else
733-
return ((png_charp) "libpng version 1.2.45 - July 7, 2011\
734-
Copyright (c) 1998-2010 Glenn Randers-Pehrson\
733+
return ((png_charp) "libpng version 1.2.52 - November 20, 2014\
734+
Copyright (c) 1998-2014 Glenn Randers-Pehrson\
735735
Copyright (c) 1996-1997 Andreas Dilger\
736736
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
737737
#endif
@@ -750,23 +750,23 @@ png_charp PNGAPI
750750
png_get_libpng_ver(png_structp png_ptr)
751751
{
752752
/* Version of *.c files used when building libpng */
753-
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
753+
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
754754
return ((png_charp) PNG_LIBPNG_VER_STRING);
755755
}
756756

757757
png_charp PNGAPI
758758
png_get_header_ver(png_structp png_ptr)
759759
{
760760
/* Version of *.h files used when building libpng */
761-
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
761+
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
762762
return ((png_charp) PNG_LIBPNG_VER_STRING);
763763
}
764764

765765
png_charp PNGAPI
766766
png_get_header_version(png_structp png_ptr)
767767
{
768768
/* Returns longer string containing both version and date */
769-
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
769+
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
770770
#ifdef __STDC__
771771
return ((png_charp) PNG_HEADER_VERSION_STRING
772772
#ifndef PNG_READ_SUPPORTED
@@ -1009,14 +1009,6 @@ png_check_IHDR(png_structp png_ptr,
10091009
error = 1;
10101010
}
10111011

1012-
if ( width > (PNG_UINT_32_MAX
1013-
>> 3) /* 8-byte RGBA pixels */
1014-
- 64 /* bigrowbuf hack */
1015-
- 1 /* filter byte */
1016-
- 7*8 /* rounding of width to multiple of 8 pixels */
1017-
- 8) /* extra max_pixel_depth pad */
1018-
png_warning(png_ptr, "Width is too large for libpng to process pixels");
1019-
10201012
/* Check other values */
10211013
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
10221014
bit_depth != 8 && bit_depth != 16)

chromium/third_party/libpng/png.h

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* png.h - header file for PNG reference library
22
*
3-
* libpng version 1.2.45 - July 7, 2011
4-
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
3+
* libpng version 1.2.52 - November 20, 2014
4+
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
55
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
66
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
77
*
@@ -10,7 +10,7 @@
1010
* Authors and maintainers:
1111
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
1212
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
13-
* libpng versions 0.97, January 1998, through 1.2.45 - July 7, 2011: Glenn
13+
* libpng versions 0.97, January 1998, through 1.2.52 - November 20, 2014: Glenn
1414
* See also "Contributing Authors", below.
1515
*
1616
* Note about libpng version numbers:
@@ -263,10 +263,35 @@
263263
* 1.2.44rc01-03 13 10244 12.so.0.44[.0]
264264
* 1.2.44 13 10244 12.so.0.44[.0]
265265
* 1.2.45beta01-03 13 10245 12.so.0.45[.0]
266-
* 1.0.55rc01 13 10055 10.so.0.55[.0]
266+
* 1.0.55rc01 10 10055 10.so.0.55[.0]
267267
* 1.2.45rc01 13 10245 12.so.0.45[.0]
268-
* 1.0.55 13 10055 10.so.0.55[.0]
268+
* 1.0.55 10 10055 10.so.0.55[.0]
269269
* 1.2.45 13 10245 12.so.0.45[.0]
270+
* 1.2.46rc01-02 13 10246 12.so.0.46[.0]
271+
* 1.0.56 10 10056 10.so.0.56[.0]
272+
* 1.2.46 13 10246 12.so.0.46[.0]
273+
* 1.2.47beta01 13 10247 12.so.0.47[.0]
274+
* 1.2.47rc01 13 10247 12.so.0.47[.0]
275+
* 1.0.57rc01 10 10057 10.so.0.57[.0]
276+
* 1.2.47 13 10247 12.so.0.47[.0]
277+
* 1.0.57 10 10057 10.so.0.57[.0]
278+
* 1.2.48beta01 13 10248 12.so.0.48[.0]
279+
* 1.2.48rc01-02 13 10248 12.so.0.48[.0]
280+
* 1.0.58 10 10058 10.so.0.58[.0]
281+
* 1.2.48 13 10248 12.so.0.48[.0]
282+
* 1.2.49rc01 13 10249 12.so.0.49[.0]
283+
* 1.0.59 10 10059 10.so.0.59[.0]
284+
* 1.2.49 13 10249 12.so.0.49[.0]
285+
* 1.0.60 10 10060 10.so.0.60[.0]
286+
* 1.2.50 13 10250 12.so.0.50[.0]
287+
* 1.2.51beta01-05 13 10251 12.so.0.51[.0]
288+
* 1.2.51rc01-04 13 10251 12.so.0.51[.0]
289+
* 1.0.61 10 10061 10.so.0.61[.0]
290+
* 1.2.51 13 10251 12.so.0.51[.0]
291+
* 1.2.52beta01 13 10252 12.so.0.52[.0]
292+
* 1.2.52rc01-02 13 10252 12.so.0.52[.0]
293+
* 1.0.62 10 10062 10.so.0.62[.0]
294+
* 1.2.52 13 10252 12.so.0.52[.0]
270295
*
271296
* Henceforth the source version will match the shared-library major
272297
* and minor numbers; the shared-library major version number will be
@@ -298,8 +323,8 @@
298323
*
299324
* This code is released under the libpng license.
300325
*
301-
* libpng versions 1.2.6, August 15, 2004, through 1.2.45, July 7, 2011, are
302-
* Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
326+
* libpng versions 1.2.6, August 15, 2004, through 1.2.52, November 20, 2014, are
327+
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
303328
* distributed according to the same disclaimer and license as libpng-1.2.5
304329
* with the following individual added to the list of Contributing Authors:
305330
*
@@ -410,13 +435,13 @@
410435
* Y2K compliance in libpng:
411436
* =========================
412437
*
413-
* July 7, 2011
438+
* November 20, 2014
414439
*
415440
* Since the PNG Development group is an ad-hoc body, we can't make
416441
* an official declaration.
417442
*
418443
* This is your unofficial assurance that libpng from version 0.71 and
419-
* upward through 1.2.45 are Y2K compliant. It is my belief that earlier
444+
* upward through 1.2.52 are Y2K compliant. It is my belief that earlier
420445
* versions were also Y2K compliant.
421446
*
422447
* Libpng only has three year fields. One is a 2-byte unsigned integer
@@ -472,17 +497,17 @@
472497
*/
473498

474499
/* Version information for png.h - this should match the version in png.c */
475-
#define PNG_LIBPNG_VER_STRING "1.2.45"
500+
#define PNG_LIBPNG_VER_STRING "1.2.52"
476501
#define PNG_HEADER_VERSION_STRING \
477-
" libpng version 1.2.45 - July 7, 2011\n"
502+
" libpng version 1.2.52 - November 20, 2014\n"
478503

479504
#define PNG_LIBPNG_VER_SONUM 0
480505
#define PNG_LIBPNG_VER_DLLNUM 13
481506

482507
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
483508
#define PNG_LIBPNG_VER_MAJOR 1
484509
#define PNG_LIBPNG_VER_MINOR 2
485-
#define PNG_LIBPNG_VER_RELEASE 45
510+
#define PNG_LIBPNG_VER_RELEASE 52
486511
/* This should match the numeric part of the final component of
487512
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
488513
*/
@@ -512,7 +537,7 @@
512537
* version 1.0.0 was mis-numbered 100 instead of 10000). From
513538
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
514539
*/
515-
#define PNG_LIBPNG_VER 10245 /* 1.2.45 */
540+
#define PNG_LIBPNG_VER 10252 /* 1.2.52 */
516541

517542
#ifndef PNG_VERSION_INFO_ONLY
518543
/* Include the compression library's header */
@@ -1552,7 +1577,7 @@ struct png_struct_def
15521577
/* This triggers a compiler error in png.c, if png.c and png.h
15531578
* do not agree upon the version number.
15541579
*/
1555-
typedef png_structp version_1_2_45;
1580+
typedef png_structp version_1_2_52;
15561581

15571582
typedef png_struct FAR * FAR * png_structpp;
15581583

@@ -2639,23 +2664,23 @@ extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr,
26392664
# define png_debug(l,m) \
26402665
{ \
26412666
int num_tabs=l; \
2642-
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
2667+
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
26432668
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
26442669
}
26452670
# endif
26462671
# ifndef png_debug1
26472672
# define png_debug1(l,m,p1) \
26482673
{ \
26492674
int num_tabs=l; \
2650-
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
2675+
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
26512676
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
26522677
}
26532678
# endif
26542679
# ifndef png_debug2
26552680
# define png_debug2(l,m,p1,p2) \
26562681
{ \
26572682
int num_tabs=l; \
2658-
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
2683+
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
26592684
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
26602685
}
26612686
# endif

chromium/third_party/libpng/pngconf.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
/* pngconf.h - machine configurable file for libpng
33
*
4-
* libpng version 1.2.45 - July 7, 2011
5-
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
4+
* libpng version 1.2.52 - November 20, 2014
5+
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
66
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
77
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
88
*
@@ -86,6 +86,18 @@
8686
#endif
8787
/* End of material added at libpng-1.2.19/1.2.21 */
8888

89+
/* Added at libpng-1.2.51 (ported from 1.4.6) */
90+
#ifndef PNG_UNUSED
91+
/* Unused formal parameter warnings are silenced using the following macro
92+
* which is expected to have no bad effects on performance (optimizing
93+
* compilers will probably remove it entirely). Note that if you replace
94+
* it with something other than whitespace, you must include the terminating
95+
* semicolon.
96+
*/
97+
# define PNG_UNUSED(param) (void)param;
98+
#endif
99+
/* End of material added to libpng-1.4.6 */
100+
89101
/* This is the size of the compression buffer, and thus the size of
90102
* an IDAT chunk. Make this whatever size you feel is best for your
91103
* machine. One of these will be allocated per png_struct. When this
@@ -868,7 +880,7 @@
868880
* how large, set these two limits to 0.
869881
*/
870882
#ifndef PNG_USER_CHUNK_CACHE_MAX
871-
# define PNG_USER_CHUNK_CACHE_MAX 0
883+
# define PNG_USER_CHUNK_CACHE_MAX 32765
872884
#endif
873885

874886
/* Added at libpng-1.2.43 */

0 commit comments

Comments
 (0)