summaryrefslogtreecommitdiffstats
path: root/third_party/libpng
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 17:34:18 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 17:34:18 +0000
commit295105baa982733ebb2d59c448049c3eb52aa95c (patch)
tree3a0d43cbac5f8d57bd44f29782a0be2f090e44f2 /third_party/libpng
parent3a0cb84cb8aa37bcf6ee940eb3679b7f4554abdf (diff)
downloadchromium_src-295105baa982733ebb2d59c448049c3eb52aa95c.zip
chromium_src-295105baa982733ebb2d59c448049c3eb52aa95c.tar.gz
chromium_src-295105baa982733ebb2d59c448049c3eb52aa95c.tar.bz2
libpng: update to 1.2.44
r50937 updated the important bits of libpng to 1.2.44 but missed a few files. This change reduces the diffs between the upstream 1.2.44 and our copy to nothing (for *.c *.h). TEST=none BUG=none TBR=mhm git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63744 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libpng')
-rw-r--r--third_party/libpng/png.c6
-rw-r--r--third_party/libpng/png.h20
-rw-r--r--third_party/libpng/pngconf.h2
-rw-r--r--third_party/libpng/pngpread.c73
-rw-r--r--third_party/libpng/pngrutil.c120
-rw-r--r--third_party/libpng/pngwio.c2
6 files changed, 113 insertions, 110 deletions
diff --git a/third_party/libpng/png.c b/third_party/libpng/png.c
index da611c9..7ad9538 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_43 Your_png_h_is_not_version_1_2_43;
+typedef version_1_2_44 Your_png_h_is_not_version_1_2_44;
/* 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.43 - February 25, 2010" PNG_STRING_NEWLINE \
+ "libpng version 1.2.44 - June 26, 2010" 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.43 - February 25, 2010\
+ return ((png_charp) "libpng version 1.2.44 - June 26, 2010\
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 1ed5426..cc1915d 100644
--- a/third_party/libpng/png.h
+++ b/third_party/libpng/png.h
@@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.2.43 - February 25, 2010
+ * libpng version 1.2.44 - June 26, 2010
* Copyright (c) 1998-2010 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.43 - February 25, 2010: Glenn
+ * libpng versions 0.97, January 1998, through 1.2.44 - June 26, 2010: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -293,7 +293,7 @@
*
* This code is released under the libpng license.
*
- * libpng versions 1.2.6, August 15, 2004, through 1.2.43, February 25, 2010, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.2.44, June 26, 2010, 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 +405,13 @@
* Y2K compliance in libpng:
* =========================
*
- * February 25, 2010
+ * June 26, 2010
*
* 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.43 are Y2K compliant. It is my belief that earlier
+ * upward through 1.2.44 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 +467,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.2.43"
+#define PNG_LIBPNG_VER_STRING "1.2.44"
#define PNG_HEADER_VERSION_STRING \
- " libpng version 1.2.43 - February 25, 2010\n"
+ " libpng version 1.2.44 - June 26, 2010\n"
#define PNG_LIBPNG_VER_SONUM 0
#define PNG_LIBPNG_VER_DLLNUM 13
@@ -477,7 +477,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 43
+#define PNG_LIBPNG_VER_RELEASE 44
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
@@ -507,7 +507,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 10243 /* 1.2.43 */
+#define PNG_LIBPNG_VER 10244 /* 1.2.44 */
#ifndef PNG_VERSION_INFO_ONLY
/* Include the compression library's header */
@@ -1547,7 +1547,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_43;
+typedef png_structp version_1_2_44;
typedef png_struct FAR * FAR * png_structpp;
diff --git a/third_party/libpng/pngconf.h b/third_party/libpng/pngconf.h
index 895d70a..defc16d 100644
--- a/third_party/libpng/pngconf.h
+++ b/third_party/libpng/pngconf.h
@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.2.43 - February 25, 2010
+ * libpng version 1.2.44 - June 26, 2010
* Copyright (c) 1998-2010 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/pngpread.c b/third_party/libpng/pngpread.c
index 48608f6..d066944 100644
--- a/third_party/libpng/pngpread.c
+++ b/third_party/libpng/pngpread.c
@@ -806,6 +806,7 @@ png_push_read_IDAT(png_structp png_ptr)
save_size = png_ptr->current_buffer_size;
png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size);
+
png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size);
png_ptr->idat_size -= save_size;
@@ -849,6 +850,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
{
int ret;
+
/* We have data for zlib, but we must check that zlib
* has somewhere to put the results. It doesn't matter
* if we don't expect any results -- it may be the input
@@ -874,50 +876,49 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
/* Check for any failure before proceeding. */
if (ret != Z_OK && ret != Z_STREAM_END)
{
- /* Terminate the decompression. */
- png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
+ /* Terminate the decompression. */
+ png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
+
/* This may be a truncated stream (missing or
- * damaged end code). Treat that as a warning.
- */
+ * damaged end code). Treat that as a warning.
+ */
if (png_ptr->row_number >= png_ptr->num_rows ||
- png_ptr->pass > 6)
- png_warning(png_ptr, "Truncated compressed data in IDAT");
- else
- png_error(png_ptr, "Decompression error in IDAT");
+ png_ptr->pass > 6)
+ png_warning(png_ptr, "Truncated compressed data in IDAT");
+ else
+ png_error(png_ptr, "Decompression error in IDAT");
- /* Skip the check on unprocessed input */
+ /* Skip the check on unprocessed input */
return;
}
/* Did inflate output any data? */
if (png_ptr->zstream.next_out != png_ptr->row_buf)
{
- /* Is this unexpected data after the last row?
- * If it is, artificially terminate the LZ output
- * here.
- */
+ /* Is this unexpected data after the last row?
+ * If it is, artificially terminate the LZ output
+ * here.
+ */
if (png_ptr->row_number >= png_ptr->num_rows ||
- png_ptr->pass > 6)
+ png_ptr->pass > 6)
{
- /* Extra data. */
- png_warning(png_ptr, "Extra compressed data in IDAT");
- png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
- /* Do no more processing; skip the unprocessed
- * input check below.
- */
+ /* Extra data. */
+ png_warning(png_ptr, "Extra compressed data in IDAT");
+ png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
+ /* Do no more processing; skip the unprocessed
+ * input check below.
+ */
return;
- }
+ }
- /* Do we have a complete row? */
- if (png_ptr->zstream.avail_out == 0)
- png_push_process_row(png_ptr);
+ /* Do we have a complete row? */
+ if (png_ptr->zstream.avail_out == 0)
+ png_push_process_row(png_ptr);
}
- else
- break;
/* And check for the end of the stream. */
if (ret == Z_STREAM_END)
- png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
+ png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
}
/* All the data should have been processed, if anything
@@ -941,8 +942,8 @@ png_push_process_row(png_structp png_ptr)
png_ptr->row_info.width);
png_read_filter_row(png_ptr, &(png_ptr->row_info),
- png_ptr->row_buf + 1, png_ptr->prev_row + 1,
- (int)(png_ptr->row_buf[0]));
+ png_ptr->row_buf + 1, png_ptr->prev_row + 1,
+ (int)(png_ptr->row_buf[0]));
png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf,
png_ptr->rowbytes + 1);
@@ -957,7 +958,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass < 6)
/* old interface (pre-1.0.9):
png_do_read_interlace(&(png_ptr->row_info),
- png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
+ png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
*/
png_do_read_interlace(png_ptr);
@@ -992,7 +993,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass == 6 && png_ptr->height <= 4)
{
- png_push_have_row(png_ptr, png_bytep_NULL);
+ png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}
@@ -1032,7 +1033,7 @@ png_push_process_row(png_structp png_ptr)
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
{
- png_push_have_row(png_ptr, png_bytep_NULL);
+ png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}
@@ -1082,13 +1083,13 @@ png_push_process_row(png_structp png_ptr)
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
{
- png_push_have_row(png_ptr, png_bytep_NULL);
+ png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}
if (png_ptr->pass == 6) /* Pass 5 might be empty */
{
- png_push_have_row(png_ptr, png_bytep_NULL);
+ png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}
@@ -1107,7 +1108,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass == 6) /* Skip top generated row */
{
- png_push_have_row(png_ptr, png_bytep_NULL);
+ png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}
@@ -1121,7 +1122,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass != 6)
break;
- png_push_have_row(png_ptr, png_bytep_NULL);
+ png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}
}
diff --git a/third_party/libpng/pngrutil.c b/third_party/libpng/pngrutil.c
index a2b39cc2..1e2db31 100644
--- a/third_party/libpng/pngrutil.c
+++ b/third_party/libpng/pngrutil.c
@@ -220,7 +220,7 @@ png_crc_error(png_structp png_ptr)
defined(PNG_READ_iCCP_SUPPORTED)
static png_size_t
png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size,
- png_bytep output, png_size_t output_size)
+ png_bytep output, png_size_t output_size)
{
png_size_t count = 0;
@@ -246,11 +246,11 @@ png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size,
if ((ret == Z_OK || ret == Z_STREAM_END) && avail > 0)
{
if (output != 0 && output_size > count)
- {
- int copy = output_size - count;
- if (avail < copy) copy = avail;
- png_memcpy(output + count, png_ptr->zbuf, copy);
- }
+ {
+ int copy = output_size - count;
+ if (avail < copy) copy = avail;
+ png_memcpy(output + count, png_ptr->zbuf, copy);
+ }
count += avail;
}
@@ -272,32 +272,32 @@ png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size,
*/
{
PNG_CONST char *msg;
- if (png_ptr->zstream.msg != 0)
- msg = png_ptr->zstream.msg;
- else
- {
+ if (png_ptr->zstream.msg != 0)
+ msg = png_ptr->zstream.msg;
+ else
+ {
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
- char umsg[52];
-
- switch (ret)
- {
- case Z_BUF_ERROR:
- msg = "Buffer error in compressed datastream in %s chunk";
- break;
- case Z_DATA_ERROR:
- msg = "Data error in compressed datastream in %s chunk";
- break;
- default:
- msg = "Incomplete compressed datastream in %s chunk";
- break;
- }
-
- png_snprintf(umsg, sizeof umsg, msg, png_ptr->chunk_name);
- msg = umsg;
+ char umsg[52];
+
+ switch (ret)
+ {
+ case Z_BUF_ERROR:
+ msg = "Buffer error in compressed datastream in %s chunk";
+ break;
+ case Z_DATA_ERROR:
+ msg = "Data error in compressed datastream in %s chunk";
+ break;
+ default:
+ msg = "Incomplete compressed datastream in %s chunk";
+ break;
+ }
+
+ png_snprintf(umsg, sizeof umsg, msg, png_ptr->chunk_name);
+ msg = umsg;
#else
- msg = "Damaged compressed datastream in chunk other than IDAT";
+ msg = "Damaged compressed datastream in chunk other than IDAT";
#endif
- }
+ }
png_warning(png_ptr, msg);
}
@@ -332,9 +332,9 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
else if (comp_type == PNG_COMPRESSION_TYPE_BASE)
{
png_size_t expanded_size = png_inflate(png_ptr,
- (png_bytep)(png_ptr->chunkdata + prefix_size),
+ (png_bytep)(png_ptr->chunkdata + prefix_size),
chunklength - prefix_size,
- 0/*output*/, 0/*output size*/);
+ 0/*output*/, 0/*output size*/);
/* Now check the limits on this chunk - if the limit fails the
* compressed data will be removed, the prefix will remain.
@@ -343,10 +343,10 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
if (png_ptr->user_chunk_malloc_max &&
(prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1))
#else
-#ifdef PNG_USER_CHUNK_MALLOC_MAX
+# ifdef PNG_USER_CHUNK_MALLOC_MAX
if ((PNG_USER_CHUNK_MALLOC_MAX > 0) &&
prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1)
-#endif
+# endif
#endif
png_warning(png_ptr, "Exceeded size limit while expanding chunk");
@@ -359,34 +359,34 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
defined(PNG_USER_CHUNK_MALLOC_MAX)
else
#endif
- if (expanded_size > 0
+ if (expanded_size > 0)
{
/* Success (maybe) - really uncompress the chunk. */
- png_size_t new_size = 0;
- png_charp text = png_malloc_warn(png_ptr,
- prefix_size + expanded_size + 1);
+ png_size_t new_size = 0;
+ png_charp text = png_malloc_warn(png_ptr,
+ prefix_size + expanded_size + 1);
if (text != NULL)
{
- png_memcpy(text, png_ptr->chunkdata, prefix_size);
- new_size = png_inflate(png_ptr,
+ png_memcpy(text, png_ptr->chunkdata, prefix_size);
+ new_size = png_inflate(png_ptr,
(png_bytep)(png_ptr->chunkdata + prefix_size),
- chunklength - prefix_size,
+ chunklength - prefix_size,
(png_bytep)(text + prefix_size), expanded_size);
- text[prefix_size + expanded_size] = 0; /* just in case */
-
- if (new_size == expanded_size)
- {
- png_free(png_ptr, png_ptr->chunkdata);
- png_ptr->chunkdata = text;
- *newlength = prefix_size + expanded_size;
- return; /* The success return! */
- }
-
- png_warning(png_ptr, "png_inflate logic error");
- png_free(png_ptr, text);
- }
- else
+ text[prefix_size + expanded_size] = 0; /* just in case */
+
+ if (new_size == expanded_size)
+ {
+ png_free(png_ptr, png_ptr->chunkdata);
+ png_ptr->chunkdata = text;
+ *newlength = prefix_size + expanded_size;
+ return; /* The success return! */
+ }
+
+ png_warning(png_ptr, "png_inflate logic error");
+ png_free(png_ptr, text);
+ }
+ else
png_warning(png_ptr, "Not enough memory to decompress chunk.");
}
}
@@ -414,13 +414,13 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
png_charp text = png_malloc_warn(png_ptr, prefix_size + 1);
if (text != NULL)
{
- if (prefix_size > 0)
+ if (prefix_size > 0)
png_memcpy(text, png_ptr->chunkdata, prefix_size);
- png_free(png_ptr, png_ptr->chunkdata);
- png_ptr->chunkdata = text;
+ png_free(png_ptr, png_ptr->chunkdata);
+ png_ptr->chunkdata = text;
- /* This is an extra zero in the 'uncompressed' part. */
- *(png_ptr->chunkdata + prefix_size) = 0x00;
+ /* This is an extra zero in the 'uncompressed' part. */
+ *(png_ptr->chunkdata + prefix_size) = 0x00;
}
/* Ignore a malloc error here - it is safe. */
}
@@ -1850,6 +1850,8 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
if (swidth == NULL)
{
png_warning(png_ptr, "Out of memory while processing sCAL chunk width");
+ png_free(png_ptr, png_ptr->chunkdata);
+ png_ptr->chunkdata = NULL;
return;
}
png_memcpy(swidth, ep, (png_size_t)png_strlen(ep));
diff --git a/third_party/libpng/pngwio.c b/third_party/libpng/pngwio.c
index 5a4d04a..44e5ea9 100644
--- a/third_party/libpng/pngwio.c
+++ b/third_party/libpng/pngwio.c
@@ -174,7 +174,7 @@ png_default_flush(png_structp png_ptr)
* arguments a pointer to a png_struct. After a call to
* the flush function, there should be no data in any buffers
* or pending transmission. If the output method doesn't do
- * any buffering of ouput, a function prototype must still be
+ * any buffering of output, a function prototype must still be
* supplied although it doesn't have to do anything. If
* PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile
* time, output_flush_fn will be ignored, although it must be