diff -ru4N libpng-1.2.23/Makefile.am libpng-1.2.24beta01/Makefile.am
--- libpng-1.2.23/Makefile.am	2007-11-06 10:09:11.591589000 -0600
+++ libpng-1.2.24beta01/Makefile.am	2007-11-19 20:02:08.697816000 -0600
@@ -100,10 +100,10 @@
 libpng.sym: png.h pngconf.h
 	rm -f $@ $@.new
 	$(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \
 		$(SED) -n -e \
-                's|^.*PNG_FUNCTION_EXPORT[ 	]*\([$(AN)]*\).*$$|\1|p' \
-		-e 's|^.*PNG_DATA_EXPORT[ 	]*\([$(AN)]*\).*$$|\1|p' \
+		's|^.*PNG_FUNCTION_EXPORT[ 	]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
+		-e 's|^.*PNG_DATA_EXPORT[ 	]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
 			>$@.new
 	mv $@.new $@
 
 libpng.vers: libpng.sym
diff -ru4N libpng-1.2.23/Makefile.in libpng-1.2.24beta01/Makefile.in
--- libpng-1.2.23/Makefile.in	2007-11-06 10:09:11.639712000 -0600
+++ libpng-1.2.24beta01/Makefile.in	2007-11-19 20:02:08.765965000 -0600
@@ -205,8 +205,9 @@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PNGLIB_MAJOR = @PNGLIB_MAJOR@
 PNGLIB_MINOR = @PNGLIB_MINOR@
 PNGLIB_RELEASE = @PNGLIB_RELEASE@
+SYMBOL_PREFIX = @SYMBOL_PREFIX@
 PNGLIB_VERSION = @PNGLIB_VERSION@
 POW_LIB = @POW_LIB@
 RANLIB = @RANLIB@
 SED = @SED@
@@ -1233,10 +1234,10 @@
 libpng.sym: png.h pngconf.h
 	rm -f $@ $@.new
 	$(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \
 		$(SED) -n -e \
-                's|^.*PNG_FUNCTION_EXPORT[ 	]*\([$(AN)]*\).*$$|\1|p' \
-		-e 's|^.*PNG_DATA_EXPORT[ 	]*\([$(AN)]*\).*$$|\1|p' \
+		's|^.*PNG_FUNCTION_EXPORT[ 	]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
+		-e 's|^.*PNG_DATA_EXPORT[ 	]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
 			>$@.new
 	mv $@.new $@
 
 libpng.vers: libpng.sym
diff -ru4N libpng-1.2.23/configure libpng-1.2.24beta01/configure
--- libpng-1.2.23/configure	2007-11-06 10:09:11.825825000 -0600
+++ libpng-1.2.24beta01/configure	2007-11-19 20:02:09.244209000 -0600
@@ -878,8 +878,9 @@
 LIBPNG_DEFINES
 LIBPNG_NO_MMX
 HAVE_LD_VERSION_SCRIPT_TRUE
 HAVE_LD_VERSION_SCRIPT_FALSE
+SYMBOL_PREFIX
 PNGLIB_VERSION
 PNGLIB_MAJOR
 PNGLIB_MINOR
 PNGLIB_RELEASE
@@ -20788,8 +20789,20 @@
   HAVE_LD_VERSION_SCRIPT_FALSE=
 fi
 
 
+if test "$have_ld_version_script" = "yes"; then
+    { echo "$as_me:$LINENO: checking for symbol prefix" >&5
+echo $ECHO_N "checking for symbol prefix... $ECHO_C" >&6; }
+    SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
+                   | ${CPP-${CC-gcc} -E} - 2>&1 \
+                   | ${EGREP-grep} "^PREFIX=" \
+                   | ${SED-sed} "s:^PREFIX=::"`
+
+    { echo "$as_me:$LINENO: result: $SYMBOL_PREFIX" >&5
+echo "${ECHO_T}$SYMBOL_PREFIX" >&6; }
+fi
+
 # Substitutions for .in files
 
 
 
@@ -21665,8 +21678,9 @@
 LIBPNG_DEFINES!$LIBPNG_DEFINES$ac_delim
 LIBPNG_NO_MMX!$LIBPNG_NO_MMX$ac_delim
 HAVE_LD_VERSION_SCRIPT_TRUE!$HAVE_LD_VERSION_SCRIPT_TRUE$ac_delim
 HAVE_LD_VERSION_SCRIPT_FALSE!$HAVE_LD_VERSION_SCRIPT_FALSE$ac_delim
+SYMBOL_PREFIX!$SYMBOL_PREFIX$ac_delim
 PNGLIB_VERSION!$PNGLIB_VERSION$ac_delim
 PNGLIB_MAJOR!$PNGLIB_MAJOR$ac_delim
 PNGLIB_MINOR!$PNGLIB_MINOR$ac_delim
 PNGLIB_RELEASE!$PNGLIB_RELEASE$ac_delim
@@ -21675,9 +21689,9 @@
 compatlib!$compatlib$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 22; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
diff -ru4N libpng-1.2.23/configure.ac libpng-1.2.24beta01/configure.ac
--- libpng-1.2.23/configure.ac	2007-11-06 10:09:11.693438000 -0600
+++ libpng-1.2.24beta01/configure.ac	2007-11-19 20:02:08.793146000 -0600
@@ -83,8 +83,18 @@
     AC_MSG_WARN(*** You have not enabled versioned symbols.)
 fi
 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
 
+if test "$have_ld_version_script" = "yes"; then
+    AC_MSG_CHECKING([for symbol prefix])
+    SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
+                   | ${CPP-${CC-gcc} -E} - 2>&1 \
+                   | ${EGREP-grep} "^PREFIX=" \
+                   | ${SED-sed} "s:^PREFIX=::"`
+    AC_SUBST(SYMBOL_PREFIX)
+    AC_MSG_RESULT($SYMBOL_PREFIX)
+fi
+
 # Substitutions for .in files
 AC_SUBST(PNGLIB_VERSION)
 AC_SUBST(PNGLIB_MAJOR)
 AC_SUBST(PNGLIB_MINOR)
Binary files libpng-1.2.23/contrib/gregbook/toucan.png and libpng-1.2.24beta01/contrib/gregbook/toucan.png differ
diff -ru4N libpng-1.2.23/png.h libpng-1.2.24beta01/png.h
--- libpng-1.2.23/png.h	2007-11-06 10:08:40.792493000 -0600
+++ libpng-1.2.24beta01/png.h	2007-11-19 20:01:48.929806000 -0600
@@ -171,8 +171,9 @@
  *    1.2.22                  13    10222  12.so.0.22[.0]
  *    1.2.23beta01-05         13    10223  12.so.0.23[.0]
  *    1.2.23rc01              13    10223  12.so.0.23[.0]
  *    1.2.23                  13    10223  12.so.0.23[.0]
+ *    1.2.24beta01            13    10224  12.so.0.24[.0]
  *
  *    Henceforth the source version will match the shared-library major
  *    and minor numbers; the shared-library major version number will be
  *    used for changes in backward compatibility, as it is intended.  The
@@ -1183,12 +1184,14 @@
    png_uint_32 iwidth;        /* width of current interlaced row in pixels */
    png_uint_32 row_number;    /* current row in interlace pass */
    png_bytep prev_row;        /* buffer to save previous (unfiltered) row */
    png_bytep row_buf;         /* buffer to save current (unfiltered) row */
+#ifndef PNG_NO_WRITE_FILTERING
    png_bytep sub_row;         /* buffer to save "sub" row when filtering */
    png_bytep up_row;          /* buffer to save "up" row when filtering */
    png_bytep avg_row;         /* buffer to save "avg" row when filtering */
    png_bytep paeth_row;       /* buffer to save "Paeth" row when filtering */
+#endif
    png_row_info row_info;     /* used for transformation routines */
 
    png_uint_32 idat_size;     /* current IDAT size for read */
    png_uint_32 crc;           /* current chunk CRC value */
diff -ru4N libpng-1.2.23/pngerror.c libpng-1.2.24beta01/pngerror.c
--- libpng-1.2.23/pngerror.c	2007-11-06 10:08:40.889594000 -0600
+++ libpng-1.2.24beta01/pngerror.c	2007-11-19 20:01:49.131850000 -0600
@@ -1,8 +1,8 @@
 
 /* pngerror.c - stub functions for i/o and memory allocation
  *
- * Last changed in libpng 1.2.22 [%DATE%]
+ * Last changed in libpng 1.2.22 [October 13, 2007]
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 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 -ru4N libpng-1.2.23/pngpread.c libpng-1.2.24beta01/pngpread.c
--- libpng-1.2.23/pngpread.c	2007-11-06 10:08:40.977490000 -0600
+++ libpng-1.2.24beta01/pngpread.c	2007-11-19 20:01:49.290923000 -0600
@@ -1,8 +1,8 @@
 
 /* pngpread.c - read a png file in push mode
  *
- * Last changed in libpng 1.2.22 [%DATE%]
+ * Last changed in libpng 1.2.23 [November 6, 2007]
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 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 -ru4N libpng-1.2.23/pngread.c libpng-1.2.24beta01/pngread.c
--- libpng-1.2.23/pngread.c	2007-11-06 10:08:41.001603000 -0600
+++ libpng-1.2.24beta01/pngread.c	2007-11-19 20:01:49.352077000 -0600
@@ -1,8 +1,8 @@
 
 /* pngread.c - read a PNG file
  *
- * Last changed in libpng 1.2.20 September 7, 2007
+ * Last changed in libpng 1.2.24 %DATE%
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 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.)
@@ -1098,27 +1098,28 @@
 {
    png_structp png_ptr = NULL;
    png_infop info_ptr = NULL, end_info_ptr = NULL;
 #ifdef PNG_USER_MEM_SUPPORTED
-   png_free_ptr free_fn;
-   png_voidp mem_ptr;
+   png_free_ptr free_fn = NULL;
+   png_voidp mem_ptr = NULL;
 #endif
 
    png_debug(1, "in png_destroy_read_struct\n");
    if (png_ptr_ptr != NULL)
+   {
       png_ptr = *png_ptr_ptr;
+#ifdef PNG_USER_MEM_SUPPORTED
+      free_fn = png_ptr->free_fn;
+      mem_ptr = png_ptr->mem_ptr;
+#endif
+   }
 
    if (info_ptr_ptr != NULL)
       info_ptr = *info_ptr_ptr;
 
    if (end_info_ptr_ptr != NULL)
       end_info_ptr = *end_info_ptr_ptr;
 
-#ifdef PNG_USER_MEM_SUPPORTED
-   free_fn = png_ptr->free_fn;
-   mem_ptr = png_ptr->mem_ptr;
-#endif
-
    png_read_destroy(png_ptr, info_ptr, end_info_ptr);
 
    if (info_ptr != NULL)
    {
diff -ru4N libpng-1.2.23/pngrtran.c libpng-1.2.24beta01/pngrtran.c
--- libpng-1.2.23/pngrtran.c	2007-11-06 10:08:41.105903000 -0600
+++ libpng-1.2.24beta01/pngrtran.c	2007-11-19 20:01:49.527815000 -0600
@@ -1,8 +1,8 @@
 
 /* pngrtran.c - transforms the data in a row for PNG readers
  *
- * Last changed in libpng 1.2.22 [%DATE%]
+ * Last changed in libpng 1.2.22 [October 13, 2007]
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 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 -ru4N libpng-1.2.23/pngrutil.c libpng-1.2.24beta01/pngrutil.c
--- libpng-1.2.23/pngrutil.c	2007-11-06 10:08:41.137953000 -0600
+++ libpng-1.2.24beta01/pngrutil.c	2007-11-19 20:01:49.648535000 -0600
@@ -1,8 +1,8 @@
 
 /* pngrutil.c - utilities to read a PNG file
  *
- * Last changed in libpng 1.2.22 [%DATE%]
+ * Last changed in libpng 1.2.23 [November 6, 2007]
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 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 -ru4N libpng-1.2.23/pngset.c libpng-1.2.24beta01/pngset.c
--- libpng-1.2.23/pngset.c	2007-11-06 10:08:41.162136000 -0600
+++ libpng-1.2.24beta01/pngset.c	2007-11-19 20:01:49.715699000 -0600
@@ -1,8 +1,8 @@
 
 /* pngset.c - storage of image information into info struct
  *
- * Last changed in libpng 1.2.22 [%DATE%]
+ * Last changed in libpng 1.2.24 [%DATE%]
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 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.)
@@ -994,22 +994,20 @@
         {
            png_warning(png_ptr,
              "Out of memory while processing sPLT chunk");
         }
-        /* TODO: use png_malloc_warn */
         png_memcpy(to->name, from->name, length);
         to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
             from->nentries * png_sizeof(png_sPLT_entry));
-        /* TODO: use png_malloc_warn */
-        png_memcpy(to->entries, from->entries,
-            from->nentries * png_sizeof(png_sPLT_entry));
         if (to->entries == NULL)
         {
            png_warning(png_ptr,
              "Out of memory while processing sPLT chunk");
            png_free(png_ptr,to->name);
            to->name = NULL;
         }
+        png_memcpy(to->entries, from->entries,
+            from->nentries * png_sizeof(png_sPLT_entry));
         to->nentries = from->nentries;
         to->depth = from->depth;
     }
 
diff -ru4N libpng-1.2.23/pngtest.c libpng-1.2.24beta01/pngtest.c
--- libpng-1.2.23/pngtest.c	2007-11-06 10:08:41.187060000 -0600
+++ libpng-1.2.24beta01/pngtest.c	2007-11-19 20:01:49.780696000 -0600
@@ -1,10 +1,10 @@
 
 /* pngtest.c - a simple test program to test libpng
  *
- * Last changed in libpng 1.2.22 - [%DATE%]
+ * Last changed in libpng 1.2.23 - [November 6, 2007]
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998-2004 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2007 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 program reads in a PNG image, writes it out again, and then
diff -ru4N libpng-1.2.23/pngwrite.c libpng-1.2.24beta01/pngwrite.c
--- libpng-1.2.23/pngwrite.c	2007-11-06 10:08:41.270955000 -0600
+++ libpng-1.2.24beta01/pngwrite.c	2007-11-19 20:01:49.916584000 -0600
@@ -1,8 +1,8 @@
 
 /* pngwrite.c - general routines to write a PNG file
  *
- * Last changed in libpng 1.2.15 January 5, 2007
+ * Last changed in libpng 1.2.24 %DATE%
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 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.)
@@ -1059,13 +1059,15 @@
 
    /* free our memory.  png_free checks NULL for us. */
    png_free(png_ptr, png_ptr->zbuf);
    png_free(png_ptr, png_ptr->row_buf);
+#ifndef PNG_NO_WRITE_FILTERING
    png_free(png_ptr, png_ptr->prev_row);
    png_free(png_ptr, png_ptr->sub_row);
    png_free(png_ptr, png_ptr->up_row);
    png_free(png_ptr, png_ptr->avg_row);
    png_free(png_ptr, png_ptr->paeth_row);
+#endif
 
 #if defined(PNG_TIME_RFC1123_SUPPORTED)
    png_free(png_ptr, png_ptr->time_buffer);
 #endif