summaryrefslogtreecommitdiffstats
path: root/third_party/libpng/pngmem.c
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 18:22:04 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 18:22:04 +0000
commit71b9d6403ceaaef6b2b258fbb32f1a77b7c875e6 (patch)
tree30c9d23615c9d559a845b282a18b994d417e8f40 /third_party/libpng/pngmem.c
parentfe5aac24dff85b8a035dbda9660d7b470fb08df0 (diff)
downloadchromium_src-71b9d6403ceaaef6b2b258fbb32f1a77b7c875e6.zip
chromium_src-71b9d6403ceaaef6b2b258fbb32f1a77b7c875e6.tar.gz
chromium_src-71b9d6403ceaaef6b2b258fbb32f1a77b7c875e6.tar.bz2
libpng: update to 1.2.43
I unpacked libpng 1.2.43 and did: cd third_party/libpng for x in $(ls -1) ; do cp /tmp/libpng-1.2.43/$x .; done The diffs appear to all be safe. The Chromium specific config is in pngusr.h and isn't touched by this change. 1.2.43 fixes http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0205 c7013d773eb45b8ed6a864e419e544106a0dd95d /tmp/libpng-1.2.43.tar.xz BUG=38512 TEST=none http://codereview.chromium.org/1118002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libpng/pngmem.c')
-rw-r--r--third_party/libpng/pngmem.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/third_party/libpng/pngmem.c b/third_party/libpng/pngmem.c
index d1999b6..91f2765 100644
--- a/third_party/libpng/pngmem.c
+++ b/third_party/libpng/pngmem.c
@@ -1,12 +1,15 @@
/* pngmem.c - stub functions for memory allocation
*
- * Last changed in libpng 1.2.37 [June 4, 2009]
- * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.2.41 [February 25, 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.)
*
+ * This code is released under the libpng license.
+ * For conditions of distribution and use, see the disclaimer
+ * and license in png.h
+ *
* This file provides a location for all memory allocation. Users who
* need special memory handling are expected to supply replacement
* functions for png_malloc() and png_free(), and to use
@@ -15,6 +18,7 @@
*/
#define PNG_INTERNAL
+#define PNG_NO_PEDANTIC_WARNINGS
#include "png.h"
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
@@ -111,6 +115,16 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
* result, we would be truncating potentially larger memory requests
* (which should cause a fatal error) and introducing major problems.
*/
+png_voidp /* PRIVATE */
+png_calloc(png_structp png_ptr, png_uint_32 size)
+{
+ png_voidp ret;
+
+ ret = (png_malloc(png_ptr, size));
+ if (ret != NULL)
+ png_memset(ret,0,(png_size_t)size);
+ return (ret);
+}
png_voidp PNGAPI
png_malloc(png_structp png_ptr, png_uint_32 size)
@@ -187,7 +201,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
{
#ifndef PNG_USER_MEM_SUPPORTED
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
- png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */
+ png_error(png_ptr, "Out Of Memory."); /* Note "O", "M" */
else
png_warning(png_ptr, "Out Of Memory.");
#endif
@@ -215,7 +229,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
{
#ifndef PNG_USER_MEM_SUPPORTED
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
- png_error(png_ptr, "Out Of memory."); /* Note "O" and "M" */
+ png_error(png_ptr, "Out Of memory."); /* Note "O", "m" */
else
png_warning(png_ptr, "Out Of memory.");
#endif
@@ -428,6 +442,16 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
* have the ability to do that.
*/
+png_voidp PNGAPI
+png_calloc(png_structp png_ptr, png_uint_32 size)
+{
+ png_voidp ret;
+
+ ret = (png_malloc(png_ptr, size));
+ if (ret != NULL)
+ png_memset(ret,0,(png_size_t)size);
+ return (ret);
+}
png_voidp PNGAPI
png_malloc(png_structp png_ptr, png_uint_32 size)
@@ -535,7 +559,7 @@ png_free_default(png_structp png_ptr, png_voidp ptr)
#endif /* Not Borland DOS special memory handler */
-#if defined(PNG_1_0_X)
+#ifdef PNG_1_0_X
# define png_malloc_warn png_malloc
#else
/* This function was added at libpng version 1.2.3. The png_malloc_warn()