summaryrefslogtreecommitdiffstats
path: root/third_party/libpng
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 14:31:49 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-29 14:31:49 +0000
commit6386cba6578f9e434a1db539e9e94e695aa69d4f (patch)
treed2c1efaed44d215104e1311d998c27afe1161f82 /third_party/libpng
parentccc6c392f6b7e0cae9166041fb48cc2d43c1e83e (diff)
downloadchromium_src-6386cba6578f9e434a1db539e9e94e695aa69d4f.zip
chromium_src-6386cba6578f9e434a1db539e9e94e695aa69d4f.tar.gz
chromium_src-6386cba6578f9e434a1db539e9e94e695aa69d4f.tar.bz2
libpng: update to 1.2.45
This is the result of applying the diff from upstream's 1.2.44 -> 1.2.45. I didn't use upstream's provided diff because it's clearly wrong. BUG=89898 TEST=none Review URL: http://codereview.chromium.org/7464050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94667 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libpng')
-rw-r--r--third_party/libpng/LICENSE4
-rw-r--r--third_party/libpng/README14
-rw-r--r--third_party/libpng/README.chromium5
-rw-r--r--third_party/libpng/png.c6
-rw-r--r--third_party/libpng/png.h29
-rw-r--r--third_party/libpng/pngconf.h4
-rw-r--r--third_party/libpng/pngerror.c22
-rw-r--r--third_party/libpng/pngmem.c2
-rw-r--r--third_party/libpng/pngrtran.c22
-rw-r--r--third_party/libpng/pngrutil.c12
-rw-r--r--third_party/libpng/pngwrite.c5
11 files changed, 80 insertions, 45 deletions
diff --git a/third_party/libpng/LICENSE b/third_party/libpng/LICENSE
index 662cba9..4fe0e61 100644
--- a/third_party/libpng/LICENSE
+++ b/third_party/libpng/LICENSE
@@ -10,7 +10,7 @@ this sentence.
This code is released under the libpng license.
-libpng versions 1.2.6, August 15, 2004, through 1.2.44, June 26, 2010, are
+libpng versions 1.2.6, August 15, 2004, through 1.2.45, July 7, 2011, are
Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
-February 25, 2010
+July 7, 2011
diff --git a/third_party/libpng/README b/third_party/libpng/README
index 01f5d4c..8d017db 100644
--- a/third_party/libpng/README
+++ b/third_party/libpng/README
@@ -1,4 +1,4 @@
-README for libpng version 1.2.44 - June 26, 2010 (shared library 12.0)
+README for libpng version 1.2.45 - July 7, 2011 (shared library 12.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
@@ -199,11 +199,11 @@ Files in this distribution:
makefile.std => Generic UNIX makefile (cc, creates static
libpng.a)
makefile.elf => Linux/ELF gcc makefile symbol versioning,
- creates libpng12.so.0.1.2.43)
+ creates libpng12.so.0.1.2.45)
makefile.linux => Linux/ELF makefile (gcc, creates
- libpng12.so.0.1.2.43)
+ libpng12.so.0.1.2.45)
makefile.gcmmx => Linux/ELF makefile (gcc, creates
- libpng12.so.0.1.2.43, previously
+ libpng12.so.0.1.2.45, previously
used assembler code tuned for Intel MMX
platform)
makefile.gcc => Generic makefile (gcc, creates static
@@ -228,12 +228,12 @@ Files in this distribution:
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics
- (gcc, creates libpng12.so.0.1.2.43)
+ (gcc, creates libpng12.so.0.1.2.45)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
- (gcc, creates libpng12.so.0.1.2.43)
+ (gcc, creates libpng12.so.0.1.2.45)
makefile.so9 => Solaris 9 makefile
- (gcc, creates libpng12.so.0.1.2.43)
+ (gcc, creates libpng12.so.0.1.2.45)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
diff --git a/third_party/libpng/README.chromium b/third_party/libpng/README.chromium
index 1e0b090..6266800 100644
--- a/third_party/libpng/README.chromium
+++ b/third_party/libpng/README.chromium
@@ -1,11 +1,12 @@
Name: libpng
URL: http://libpng.org/
-Version: 1.2.44
+Version: 1.2.45
+Security Critical: yes
Description:
Our custom configuration options are defined in pngusr.h. This was previously
called mozpngconf.h, which was copied from Mozilla and modified by Apple (hence
the wk_* names).
-Updated to 1.2.44, no changes to the source files but all unneeded files
+Updated to 1.2.45, no changes to the source files but all unneeded files
stripped.
diff --git a/third_party/libpng/png.c b/third_party/libpng/png.c
index 7ad9538..babad71 100644
--- a/third_party/libpng/png.c
+++ b/third_party/libpng/png.c
@@ -17,7 +17,7 @@
#include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_2_44 Your_png_h_is_not_version_1_2_44;
+typedef version_1_2_45 Your_png_h_is_not_version_1_2_45;
/* Version information for C files. This had better match the version
* string defined in png.h.
@@ -724,13 +724,13 @@ png_get_copyright(png_structp png_ptr)
#else
#ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \
- "libpng version 1.2.44 - June 26, 2010" PNG_STRING_NEWLINE \
+ "libpng version 1.2.45 - July 7, 2011" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE);
#else
- return ((png_charp) "libpng version 1.2.44 - June 26, 2010\
+ return ((png_charp) "libpng version 1.2.45 - July 7, 2011\
Copyright (c) 1998-2010 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
diff --git a/third_party/libpng/png.h b/third_party/libpng/png.h
index cc1915d..29dc52b 100644
--- a/third_party/libpng/png.h
+++ b/third_party/libpng/png.h
@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.2.44 - June 26, 2010
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * libpng version 1.2.45 - July 7, 2011
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -10,7 +10,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- * libpng versions 0.97, January 1998, through 1.2.44 - June 26, 2010: Glenn
+ * libpng versions 0.97, January 1998, through 1.2.45 - July 7, 2011: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -231,7 +231,7 @@
* 1.2.37beta01-03 13 10237 12.so.0.37[.0]
* 1.2.37rc01 13 10237 12.so.0.37[.0]
* 1.2.37 13 10237 12.so.0.37[.0]
- * 1.2.45 10 10045 12.so.0.45[.0]
+ * 1.0.45 10 10045 12.so.0.45[.0]
* 1.0.46 10 10046 10.so.0.46[.0]
* 1.2.38beta01 13 10238 12.so.0.38[.0]
* 1.2.38rc01-03 13 10238 12.so.0.38[.0]
@@ -262,6 +262,11 @@
* 1.2.44beta01-03 13 10244 12.so.0.44[.0]
* 1.2.44rc01-03 13 10244 12.so.0.44[.0]
* 1.2.44 13 10244 12.so.0.44[.0]
+ * 1.2.45beta01-03 13 10245 12.so.0.45[.0]
+ * 1.0.55rc01 13 10055 10.so.0.55[.0]
+ * 1.2.45rc01 13 10245 12.so.0.45[.0]
+ * 1.0.55 13 10055 10.so.0.55[.0]
+ * 1.2.45 13 10245 12.so.0.45[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -293,7 +298,7 @@
*
* This code is released under the libpng license.
*
- * libpng versions 1.2.6, August 15, 2004, through 1.2.44, June 26, 2010, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.2.45, July 7, 2011, are
* Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
@@ -405,13 +410,13 @@
* Y2K compliance in libpng:
* =========================
*
- * June 26, 2010
+ * July 7, 2011
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
- * upward through 1.2.44 are Y2K compliant. It is my belief that earlier
+ * upward through 1.2.45 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
@@ -467,9 +472,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.2.44"
+#define PNG_LIBPNG_VER_STRING "1.2.45"
#define PNG_HEADER_VERSION_STRING \
- " libpng version 1.2.44 - June 26, 2010\n"
+ " libpng version 1.2.45 - July 7, 2011\n"
#define PNG_LIBPNG_VER_SONUM 0
#define PNG_LIBPNG_VER_DLLNUM 13
@@ -477,7 +482,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 2
-#define PNG_LIBPNG_VER_RELEASE 44
+#define PNG_LIBPNG_VER_RELEASE 45
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
@@ -507,7 +512,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
-#define PNG_LIBPNG_VER 10244 /* 1.2.44 */
+#define PNG_LIBPNG_VER 10245 /* 1.2.45 */
#ifndef PNG_VERSION_INFO_ONLY
/* Include the compression library's header */
@@ -1547,7 +1552,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef png_structp version_1_2_44;
+typedef png_structp version_1_2_45;
typedef png_struct FAR * FAR * png_structpp;
diff --git a/third_party/libpng/pngconf.h b/third_party/libpng/pngconf.h
index defc16d..6928241 100644
--- a/third_party/libpng/pngconf.h
+++ b/third_party/libpng/pngconf.h
@@ -1,8 +1,8 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.2.44 - June 26, 2010
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * libpng version 1.2.45 - July 7, 2011
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
diff --git a/third_party/libpng/pngerror.c b/third_party/libpng/pngerror.c
index 7bc98fb..025d52e 100644
--- a/third_party/libpng/pngerror.c
+++ b/third_party/libpng/pngerror.c
@@ -1,8 +1,8 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Last changed in libpng 1.2.41 [December 3, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.2.45 [July 7, 2011]
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -87,12 +87,17 @@ png_error(png_structp png_ptr, png_const_charp error_message)
void PNGAPI
png_err(png_structp png_ptr)
{
+ /* Prior to 1.2.45 the error_fn received a NULL pointer, expressed
+ * erroneously as '\0', instead of the empty string "". This was
+ * apparently an error, introduced in libpng-1.2.20, and png_default_error
+ * will crash in this case.
+ */
if (png_ptr != NULL && png_ptr->error_fn != NULL)
- (*(png_ptr->error_fn))(png_ptr, '\0');
+ (*(png_ptr->error_fn))(png_ptr, "");
/* If the custom handler doesn't exist, or if it returns,
use the default handler, which will not return. */
- png_default_error(png_ptr, '\0');
+ png_default_error(png_ptr, "");
}
#endif /* PNG_ERROR_TEXT_SUPPORTED */
@@ -181,8 +186,13 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
{
buffer[iout++] = ':';
buffer[iout++] = ' ';
- png_memcpy(buffer + iout, error_message, PNG_MAX_ERROR_TEXT);
- buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0';
+
+ iin = 0;
+ while (iin < PNG_MAX_ERROR_TEXT-1 && error_message[iin] != '\0')
+ buffer[iout++] = error_message[iin++];
+
+ /* iin < PNG_MAX_ERROR_TEXT, so the following is safe: */
+ buffer[iout] = '\0';
}
}
diff --git a/third_party/libpng/pngmem.c b/third_party/libpng/pngmem.c
index 91f2765..a18719b 100644
--- a/third_party/libpng/pngmem.c
+++ b/third_party/libpng/pngmem.c
@@ -442,7 +442,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
* have the ability to do that.
*/
-png_voidp PNGAPI
+png_voidp /* PRIVATE */
png_calloc(png_structp png_ptr, png_uint_32 size)
{
png_voidp ret;
diff --git a/third_party/libpng/pngrtran.c b/third_party/libpng/pngrtran.c
index af1aa8e..33703d4 100644
--- a/third_party/libpng/pngrtran.c
+++ b/third_party/libpng/pngrtran.c
@@ -1,8 +1,8 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.2.43 [February 25, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.2.45 [July 7, 2011]
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -676,10 +676,21 @@ void PNGAPI
png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red,
double green)
{
- int red_fixed = (int)((float)red*100000.0 + 0.5);
- int green_fixed = (int)((float)green*100000.0 + 0.5);
+ int red_fixed, green_fixed;
if (png_ptr == NULL)
return;
+ if (red > 21474.83647 || red < -21474.83648 ||
+ green > 21474.83647 || green < -21474.83648)
+ {
+ png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients");
+ red_fixed = -1;
+ green_fixed = -1;
+ }
+ else
+ {
+ red_fixed = (int)((float)red*100000.0 + 0.5);
+ green_fixed = (int)((float)green*100000.0 + 0.5);
+ }
png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed);
}
#endif
@@ -1196,8 +1207,7 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
{
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
{
- if (png_ptr->num_trans &&
- (png_ptr->transformations & PNG_EXPAND_tRNS))
+ if (png_ptr->num_trans)
info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
else
info_ptr->color_type = PNG_COLOR_TYPE_RGB;
diff --git a/third_party/libpng/pngrutil.c b/third_party/libpng/pngrutil.c
index 1e2db31..45e7ddd 100644
--- a/third_party/libpng/pngrutil.c
+++ b/third_party/libpng/pngrutil.c
@@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Last changed in libpng 1.2.44 [June 26, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.2.45 [July 7, 2011]
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -1812,6 +1812,14 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
return;
}
+ /* Need unit type, width, \0, height: minimum 4 bytes */
+ else if (length < 4)
+ {
+ png_warning(png_ptr, "sCAL chunk too short");
+ png_crc_finish(png_ptr, length);
+ return;
+ }
+
png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)",
length + 1);
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
diff --git a/third_party/libpng/pngwrite.c b/third_party/libpng/pngwrite.c
index e411e81..1d8c53f 100644
--- a/third_party/libpng/pngwrite.c
+++ b/third_party/libpng/pngwrite.c
@@ -1,8 +1,8 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.2.42 [January 3, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.2.45 [July 7, 2011]
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -295,6 +295,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
if (keep != PNG_HANDLE_CHUNK_NEVER &&
up->location && (up->location & PNG_HAVE_PLTE) &&
!(up->location & PNG_HAVE_IDAT) &&
+ !(up->location & PNG_AFTER_IDAT) &&
((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
(png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
{