summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2013-04-14 09:28:28 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2013-04-14 09:28:28 +0000
commitbb46690f71a07eb5e99656e093751555b1bb0242 (patch)
tree22d114c7a72713e92eecd4294d54f3e0354cd9f7 /media-libs/libpng/files
parentInstall initd script with proper name. Fixes bug#465842. (diff)
downloadgentoo-2-bb46690f71a07eb5e99656e093751555b1bb0242.tar.gz
gentoo-2-bb46690f71a07eb5e99656e093751555b1bb0242.tar.bz2
gentoo-2-bb46690f71a07eb5e99656e093751555b1bb0242.zip
Patch from upstream for correcting the length written to uncompressed iTXt chunks. This caused "export to .png" with comments in media-gfx/gimp to produce corrupted files as noticed by lu_zero and jlec.
(Portage version: 2.2.0_alpha172/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'media-libs/libpng/files')
-rw-r--r--media-libs/libpng/files/libpng-1.6.1-Corrected-length-written-to-uncompressed-iT.patch47
-rw-r--r--media-libs/libpng/files/libpng-1.6.1-Fixed-previous-bugfix-to-work-on-64-bit-pla.patch32
-rw-r--r--media-libs/libpng/files/libpng-1.6.1-Removed-extra-recently-inserted-line-from-p.patch25
3 files changed, 104 insertions, 0 deletions
diff --git a/media-libs/libpng/files/libpng-1.6.1-Corrected-length-written-to-uncompressed-iT.patch b/media-libs/libpng/files/libpng-1.6.1-Corrected-length-written-to-uncompressed-iT.patch
new file mode 100644
index 000000000000..37f9d50189e3
--- /dev/null
+++ b/media-libs/libpng/files/libpng-1.6.1-Corrected-length-written-to-uncompressed-iT.patch
@@ -0,0 +1,47 @@
+From 9bb775fc8cbde98fca150992efe227937b9278ff Mon Sep 17 00:00:00 2001
+From: Glenn Randers-Pehrson <glennrp at users.sourceforge.net>
+Date: Sat, 13 Apr 2013 14:19:25 -0500
+Subject: [PATCH 1/5] [libpng16] Corrected length written to uncompressed iTXt
+ chunks (Samuli Suominen).
+
+---
+ ANNOUNCE | 1 +
+ CHANGES | 1 +
+ pngwutil.c | 6 +++---
+ 3 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/pngwutil.c b/pngwutil.c
+index 8c49cfd..8f66937 100644
+--- a/pngwutil.c
++++ b/pngwutil.c
+@@ -1,7 +1,7 @@
+
+ /* pngwutil.c - utilities to write a PNG file
+ *
+- * Last changed in libpng 1.6.0 [February 14, 2013]
++ * Last changed in libpng 1.6.2 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2013 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.)
+@@ -1738,16 +1738,16 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
+ {
+ if (png_text_compress(png_ptr, png_iTXt, &comp, prefix_len) != Z_OK)
+ png_error(png_ptr, png_ptr->zstream.msg);
++ png_write_chunk_header(png_ptr, png_iTXt, comp.output_len + prefix_len);
+ }
+
+ else
+ {
+ if (comp.input_len > PNG_UINT_31_MAX-prefix_len)
+ png_error(png_ptr, "iTXt: uncompressed text too long");
++ png_write_chunk_header(png_ptr, png_iTXt, strlen(text) + prefix_len);
+ }
+
+- png_write_chunk_header(png_ptr, png_iTXt, comp.output_len + prefix_len);
+-
+ png_write_chunk_data(png_ptr, new_key, key_len);
+
+ png_write_chunk_data(png_ptr, (png_const_bytep)lang, lang_len);
+--
+1.8.1.5
+
diff --git a/media-libs/libpng/files/libpng-1.6.1-Fixed-previous-bugfix-to-work-on-64-bit-pla.patch b/media-libs/libpng/files/libpng-1.6.1-Fixed-previous-bugfix-to-work-on-64-bit-pla.patch
new file mode 100644
index 000000000000..761b7f91f5fa
--- /dev/null
+++ b/media-libs/libpng/files/libpng-1.6.1-Fixed-previous-bugfix-to-work-on-64-bit-pla.patch
@@ -0,0 +1,32 @@
+From 70eb0720a04aa71eec6e97b568c8dd129d92c331 Mon Sep 17 00:00:00 2001
+From: John Bowler <jbowler@acm.org>
+Date: Sat, 13 Apr 2013 16:52:09 -0500
+Subject: [PATCH 2/5] [libpng16] Fixed previous bugfix to work on 64-bit
+ platforms.
+
+---
+ pngwutil.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/pngwutil.c b/pngwutil.c
+index 8f66937..755ccef 100644
+--- a/pngwutil.c
++++ b/pngwutil.c
+@@ -1745,9 +1745,13 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
+ {
+ if (comp.input_len > PNG_UINT_31_MAX-prefix_len)
+ png_error(png_ptr, "iTXt: uncompressed text too long");
+- png_write_chunk_header(png_ptr, png_iTXt, strlen(text) + prefix_len);
++
++ /* So the string will fit in a chunk: */
++ comp.output_len = (png_uint_32)/*SAFE*/comp.input_len;
+ }
+
++ png_write_chunk_header(png_ptr, png_iTXt, comp.output_len + prefix_len);
++
+ png_write_chunk_data(png_ptr, new_key, key_len);
+
+ png_write_chunk_data(png_ptr, (png_const_bytep)lang, lang_len);
+--
+1.8.1.5
+
diff --git a/media-libs/libpng/files/libpng-1.6.1-Removed-extra-recently-inserted-line-from-p.patch b/media-libs/libpng/files/libpng-1.6.1-Removed-extra-recently-inserted-line-from-p.patch
new file mode 100644
index 000000000000..199c1be7f444
--- /dev/null
+++ b/media-libs/libpng/files/libpng-1.6.1-Removed-extra-recently-inserted-line-from-p.patch
@@ -0,0 +1,25 @@
+From 5ec05b3d7cec24c73c68bad4608a4ce15da0423f Mon Sep 17 00:00:00 2001
+From: Glenn Randers-Pehrson <glennrp at users.sourceforge.net>
+Date: Sat, 13 Apr 2013 20:01:09 -0500
+Subject: [PATCH 3/5] [libpng16] Removed extra recently-inserted line from
+ pngwutil.c
+
+---
+ pngwutil.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/pngwutil.c b/pngwutil.c
+index 755ccef..f481683 100644
+--- a/pngwutil.c
++++ b/pngwutil.c
+@@ -1738,7 +1738,6 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
+ {
+ if (png_text_compress(png_ptr, png_iTXt, &comp, prefix_len) != Z_OK)
+ png_error(png_ptr, png_ptr->zstream.msg);
+- png_write_chunk_header(png_ptr, png_iTXt, comp.output_len + prefix_len);
+ }
+
+ else
+--
+1.8.1.5
+