diff -ru4NwbB libpng-1.4.8/Makefile.am libpng-1.4.9rc01/Makefile.am --- libpng-1.4.8/Makefile.am 2011-07-07 06:39:47.753324532 -0500 +++ libpng-1.4.9rc01/Makefile.am 2012-02-17 13:27:39.836574781 -0600 @@ -37,9 +37,15 @@ -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 if HAVE_LD_VERSION_SCRIPT # Versioned symbols and restricted exports + +if HAVE_SOLARIS_LD + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M -Wl,libpng.vers +else libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers +endif + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers else # Only restricted exports when possible libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym @@ -63,8 +69,9 @@ ANNOUNCE CHANGES INSTALL LICENSE README TODO \ pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \ ${srcdir}/projects/visualc6/* \ ${srcdir}/projects/visualc71/* \ + ${srcdir}/projects/vstudio/* \ ${srcdir}/projects/xcode/* \ ${srcdir}/scripts/* \ ${srcdir}/contrib/gregbook/* \ ${srcdir}/contrib/pngminim/* \ diff -ru4NwbB libpng-1.4.8/configure.ac libpng-1.4.9rc01/configure.ac --- libpng-1.4.8/configure.ac 2011-07-07 06:39:47.760375677 -0500 +++ libpng-1.4.9rc01/configure.ac 2012-02-17 13:27:39.843973109 -0600 @@ -76,9 +76,26 @@ have_ld_version_script=no AC_MSG_RESULT(no) ;; * ) + +AC_MSG_CHECKING([if using Solaris linker]) +SLD=`$LD --version 2>&1 | grep Solaris` +if test "$SLD"; then + have_solaris_ld=yes + AC_MSG_RESULT(yes) +else + have_solaris_ld=no + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(HAVE_SOLARIS_LD, test "$have_solaris_ld" = "yes") + +if test "$have_solaris_ld" = "yes"; then + GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'` +else GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` +fi + if test "$GLD"; then have_ld_version_script=yes AC_MSG_RESULT(yes) else diff -ru4NwbB libpng-1.4.8/contrib/pngminus/makefile.std libpng-1.4.9rc01/contrib/pngminus/makefile.std --- libpng-1.4.8/contrib/pngminus/makefile.std 2011-07-07 06:39:42.126842864 -0500 +++ libpng-1.4.9rc01/contrib/pngminus/makefile.std 2012-02-17 13:27:33.818367258 -0600 @@ -7,11 +7,11 @@ RM=rm -f #PNGPATH = /usr/local -#PNGINC = -I$(PNGPATH)/include/libpng12 -#PNGLIB = -L$(PNGPATH)/lib -lpng12 -#PNGLIBS = $(PNGPATH)/lib/libpng12.a +#PNGINC = -I$(PNGPATH)/include/libpng14 +#PNGLIB = -L$(PNGPATH)/lib -lpng14 +#PNGLIBS = $(PNGPATH)/lib/libpng14.a PNGINC = -I../.. PNGLIB = -L../.. -lpng PNGLIBS = ../../libpng.a @@ -22,11 +22,11 @@ ZINC = -I../../../zlib ZLIB = -L../../../zlib -lz ZLIBS = ../../../zlib/libz.a -CFLAGS=-O3 $(PNGINC) $(ZINC) -LDFLAGS=$(PNGLIB) $(ZLIB) -LDFLAGSS=$(PNGLIBS) $(ZLIBS) +CFLAGS=$(PNGINC) $(ZINC) +LDLIBS=$(PNGLIB) $(ZLIB) +LDLIBSS=$(PNGLIBS) $(ZLIBS) C=.c O=.o L=.a E= @@ -39,21 +39,21 @@ png2pnm$(O): png2pnm$(C) $(CC) -c $(CFLAGS) png2pnm$(C) png2pnm$(E): png2pnm$(O) - $(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS) -lm + $(LD) $(LDFLAGS) -o png2pnm$(E) png2pnm$(O) $(LDLIBS) -lm png2pnm-static$(E): png2pnm$(O) - $(LD) -o png2pnm-static$(E) png2pnm$(O) $(LDFLAGSS) -lm + $(LD) $(LDFLAGS) -o png2pnm-static$(E) png2pnm$(O) $(LDLIBSS) -lm pnm2png$(O): pnm2png$(C) $(CC) -c $(CFLAGS) pnm2png$(C) pnm2png$(E): pnm2png$(O) - $(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS) -lm + $(LD) $(LDFLAGS) -o pnm2png$(E) pnm2png$(O) $(LDLIBS) -lm pnm2png-static$(E): pnm2png$(O) - $(LD) -o pnm2png-static$(E) pnm2png$(O) $(LDFLAGSS) -lm + $(LD) $(LDFLAGS) -o pnm2png-static$(E) pnm2png$(O) $(LDLIBSS) -lm clean: $(RM) png2pnm$(O) $(RM) pnm2png$(O) diff -ru4NwbB libpng-1.4.8/png.h libpng-1.4.9rc01/png.h --- libpng-1.4.8/png.h 2011-07-07 06:39:41.674846861 -0500 +++ libpng-1.4.9rc01/png.h 2012-02-17 13:27:33.332968512 -0600 @@ -160,8 +160,10 @@ * 1.4.7 14 10407 14.so.14.7[.0] * 1.4.8beta01-05 14 10408 14.so.14.8[.0] * 1.4.8rc01 14 10408 14.so.14.8[.0] * 1.4.8 14 10408 14.so.14.8[.0] + * 1.4.9beta01 14 10409 14.so.14.9[.0] + * 1.4.9rc01 14 10409 14.so.14.9[.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 diff -ru4NwbB libpng-1.4.8/pngget.c libpng-1.4.9rc01/pngget.c --- libpng-1.4.8/pngget.c 2011-07-07 06:39:41.720589409 -0500 +++ libpng-1.4.9rc01/pngget.c 2012-02-17 13:27:33.382140606 -0600 @@ -1,8 +1,8 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.4.6 [April 8, 2010] + * Last changed in libpng 1.4.6 [April 8, 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 -ru4NwbB libpng-1.4.8/pngmem.c libpng-1.4.9rc01/pngmem.c --- libpng-1.4.8/pngmem.c 2011-07-07 06:39:41.726870978 -0500 +++ libpng-1.4.9rc01/pngmem.c 2012-02-17 13:27:33.389142892 -0600 @@ -1,8 +1,8 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.4.6 [April 8, 2010] + * Last changed in libpng 1.4.6 [April 8, 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 -ru4NwbB libpng-1.4.8/pngpread.c libpng-1.4.9rc01/pngpread.c --- libpng-1.4.8/pngpread.c 2011-07-07 06:39:41.736258869 -0500 +++ libpng-1.4.9rc01/pngpread.c 2012-02-17 13:27:33.399095010 -0600 @@ -700,9 +700,9 @@ new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256; old_buffer = png_ptr->save_buffer; png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr, - (png_size_t)new_max); + new_max); if (png_ptr->save_buffer == NULL) { png_free(png_ptr, old_buffer); png_error(png_ptr, "Insufficient memory for save_buffer"); @@ -1218,9 +1218,9 @@ } #endif png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_size_t)(length + 1)); + length + 1); png_ptr->current_text[length] = '\0'; png_ptr->current_text_ptr = png_ptr->current_text; png_ptr->current_text_size = (png_size_t)length; png_ptr->current_text_left = (png_size_t)length; @@ -1318,9 +1318,9 @@ } #endif png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_size_t)(length + 1)); + length + 1); png_ptr->current_text[length] = '\0'; png_ptr->current_text_ptr = png_ptr->current_text; png_ptr->current_text_size = (png_size_t)length; png_ptr->current_text_left = (png_size_t)length; @@ -1517,9 +1517,9 @@ } #endif png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_size_t)(length + 1)); + length + 1); png_ptr->current_text[length] = '\0'; png_ptr->current_text_ptr = png_ptr->current_text; png_ptr->current_text_size = (png_size_t)length; png_ptr->current_text_left = (png_size_t)length; @@ -1656,17 +1656,17 @@ png_sizeof(png_ptr->unknown_chunk.name)); png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name) - 1] = '\0'; - png_ptr->unknown_chunk.size = (png_size_t)length; + png_ptr->unknown_chunk.size = length; if (length == 0) png_ptr->unknown_chunk.data = NULL; else { png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, - (png_size_t)length); + length); png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length); } #ifdef PNG_READ_USER_CHUNKS_SUPPORTED diff -ru4NwbB libpng-1.4.8/pngrutil.c libpng-1.4.9rc01/pngrutil.c --- libpng-1.4.8/pngrutil.c 2011-07-07 06:39:41.782355205 -0500 +++ libpng-1.4.9rc01/pngrutil.c 2012-02-17 13:27:33.447187757 -0600 @@ -376,29 +376,28 @@ /* Now check the limits on this chunk - if the limit fails the * compressed data will be removed, the prefix will remain. */ + if (prefix_size >= (~(png_size_t)0) - 1 || + expanded_size >= (~(png_size_t)0) - 1 - prefix_size #ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED - if (png_ptr->user_chunk_malloc_max && + || (png_ptr->user_chunk_malloc_max && (prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1)) #else # ifdef PNG_USER_CHUNK_MALLOC_MAX - if ((PNG_USER_CHUNK_MALLOC_MAX > 0) && + || ((PNG_USER_CHUNK_MALLOC_MAX > 0) && prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1) # endif #endif + ) png_warning(png_ptr, "Exceeded size limit while expanding chunk"); /* If the size is zero either there was an error and a message * has already been output (warning) or the size really is zero * and we have nothing to do - the code will exit through the * error case below. */ -#if defined(PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED) || \ - defined(PNG_USER_CHUNK_MALLOC_MAX) - else -#endif - if (expanded_size > 0) + else if (expanded_size > 0) { /* Success (maybe) - really uncompress the chunk. */ png_size_t new_size = 0; png_charp text = png_malloc_warn(png_ptr, @@ -1260,9 +1259,9 @@ #endif png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1); - slength = (png_size_t)length; + slength = length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, skip)) { diff -ru4NwbB libpng-1.4.8/pngtrans.c libpng-1.4.9rc01/pngtrans.c --- libpng-1.4.8/pngtrans.c 2011-07-07 06:39:41.807600577 -0500 +++ libpng-1.4.9rc01/pngtrans.c 2012-02-17 13:27:33.473984576 -0600 @@ -1,8 +1,8 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.4.6 [ April 8, 2010] + * Last changed in libpng 1.4.6 [ April 8, 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.) *