summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2009-11-01 21:22:01 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2009-11-01 21:22:01 -0600
commitaf9a41d770f458ca8a7f420ff531744bfaa00444 (patch)
treed4b2ecf01d9b2caf1071bd1465b75056a7049a35
parentd6dc43db7d24c6c41073e46baca78e66197be826 (diff)
downloadlibpng-af9a41d770f458ca8a7f420ff531744bfaa00444.tar.gz
[master] Store user's user_png_ver in new png_ptr->user_png_ver element.
Revised iTXt support. To ensure binary compatibility with previous versions, the "lang" and "lang_key" members will be assumed to be omitted from versions prior to 1.2.41beta11 whenever there is a library mismatch.
-rw-r--r--ANNOUNCE9
-rw-r--r--CHANGES9
-rw-r--r--png.c6
-rw-r--r--pngset.c36
4 files changed, 44 insertions, 16 deletions
diff --git a/ANNOUNCE b/ANNOUNCE
index 144e8319a..50efaa2aa 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
-Libpng 1.2.41beta11 - November 1, 2009
+Libpng 1.2.41beta11 - November 2, 2009
This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version.
@@ -99,11 +99,12 @@ version 1.2.41beta10 [November 1, 2009]
longer necessary to gain iTXt support), as a signal that the user has
been building previous versions with PNG_iTXt_SUPPORTED as well.
-version 1.2.41beta11 [November 1, 2009]
+version 1.2.41beta11 [November 2, 2009]
+ Store user's user_png_ver in new png_ptr->user_png_ver element.
Revised iTXt support. To ensure binary compatibility with
previous versions, the "lang" and "lang_key" members will be assumed
- to be omitted from previous versions whenever there is a library
- mismatch.
+ to be omitted from versions prior to 1.2.41beta11 whenever there is a
+ library mismatch.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
diff --git a/CHANGES b/CHANGES
index 6704fe567..8eb79ec87 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2466,7 +2466,7 @@ version 1.2.40beta01 [August 20, 2009]
version 1.2.40rc01 [September 2, 2009]
Various bugfixes and improvements to CMakeLists.txt (Philip Lowman)
-version 1.2.40 and 1.0.49 [November 1, 2009]
+version 1.2.40 and 1.0.49 [November 2, 2009]
No changes.
version 1.0.50 [September 10, 2009]
@@ -2529,11 +2529,12 @@ version 1.2.41beta10 [November 1, 2009]
longer necessary to gain iTXt support), as a signal that the user has
been building previous versions with PNG_iTXt_SUPPORTED as well.
-version 1.2.41beta11 [November 1, 2009]
+version 1.2.41beta11 [November 2, 2009]
+ Store user's user_png_ver in new png_ptr->user_png_ver element.
Revised iTXt support. To ensure binary compatibility with
previous versions, the "lang" and "lang_key" members will be assumed
- to be omitted from previous versions whenever there is a library
- mismatch.
+ to be omitted from versions prior to 1.2.41beta11 whenever there is a
+ library mismatch.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/png.c b/png.c
index 71ef0b6eb..e3e3d436b 100644
--- a/png.c
+++ b/png.c
@@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.2.41 [November 1, 2009]
+ * Last changed in libpng 1.2.41 [November 2, 2009]
* Copyright (c) 1998-2009 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.)
@@ -722,13 +722,13 @@ png_get_copyright(png_structp png_ptr)
#else
#ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \
- "libpng version x 1.2.41beta11 - November 1, 2009" PNG_STRING_NEWLINE \
+ "libpng version 1.2.41beta11 - November 2, 2009" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2009 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.41beta11 - November 1, 2009\
+ return ((png_charp) "libpng version 1.2.41beta11 - November 2, 2009\
Copyright (c) 1998-2009 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
diff --git a/pngset.c b/pngset.c
index c3725d1e4..6298c955c 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct
*
- * Last changed in libpng 1.2.41 [November 1, 2009]
+ * Last changed in libpng 1.2.41 [November 2, 2009]
* Copyright (c) 1998-2009 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.)
@@ -653,7 +653,9 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
int num_text)
{
int i;
+#ifdef PNG_iTXt_SUPPORTED
int caller_no_itxt = 0;
+#endif
png_debug1(1, "in %s storage function", ((png_ptr == NULL ||
png_ptr->chunk_name[0] == '\0') ?
@@ -662,6 +664,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
return(0);
+#ifdef PNG_iTXt_SUPPORTED
/* If an earlier version of the library was used to build the
* application, it might be using a png_textp structure that
* does not contain the lang or lang_key elements. Even if you build
@@ -670,12 +673,35 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
* defined, the complete png_textp structure probably has not existed
* all along and it's not safe to access them, due to a bug in
* pngconf.h from version 1.2.9 to 1.2.40.
- *
- * To do: accept mismatched libraries when both are version 1.2.41
- * or later.
*/
if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
- caller_no_itxt = 1;
+ {
+ int j;
+ png_byte c[12];
+
+ j = 0;
+ for (j = 0; j < 12; j++)
+ c[j] = 0;
+
+ for (j = 0; c[j] && j < 12; j++)
+ c[j] = png_ptr->user_png_ver[j];
+
+ if ((c[5] == '\0') /* 1.2.N */ ||
+ (c[5] == 'b') /* 1.2.NbetaNN */ ||
+ (c[5] == 'r') /* 1.2.NrcNN */ ||
+ (c[4] == '1') /* 1.2.1x */ ||
+ (c[4] == '2') /* 1.2.2x */ ||
+ (c[4] == '3') /* 1.2.3x */ ||
+ ((c[4] == '4') /* 1.2.4x */ &&
+ (((c[5] == '0')) /* 1.2.40 */ ||
+ ((c[5] == '1') /* 1.2.41x */ &&
+ (((c[6] == 'b') /* 1.2.41betax */ &&
+ ((c[10] == '0'))) /* 1.2.41beta0x */ ||
+ ((c[10] == '1') /* 1.2.41beta1x */ &&
+ (c[11] == '0'))))))) /* 1.2.41beta10 */
+ caller_no_itxt = 1;
+ }
+#endif /* PNG_iTXt_SUPPORTED */
/* Make sure we have enough space in the "text" array in info_struct
* to hold all of the incoming text_ptr objects.