Patchwork [1/2] png: fix over-zealous warnings about transforms

login
register
mail settings
Submitter Ross Burton
Date April 17, 2013, 1:34 p.m.
Message ID <1366205668-19096-1-git-send-email-ross.burton@intel.com>
Download mbox | patch
Permalink /patch/48431/
State New
Headers show

Comments

Ross Burton - April 17, 2013, 1:34 p.m.
libpng 1.6.0/1.6.1 emits warnings about function ordering when there isn't a
problem, which causes Cairo to fail loading images.  Take the patch from
upstream to fix this.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 .../libpng/libpng/transform.patch                  |   46 ++++++++++++++++++++
 meta/recipes-multimedia/libpng/libpng_1.6.0.bb     |    2 +-
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-multimedia/libpng/libpng/transform.patch
Koen Kooi - April 17, 2013, 1:48 p.m.
Op 17 apr. 2013, om 15:34 heeft Ross Burton <ross.burton@intel.com> het volgende geschreven:

> libpng 1.6.0/1.6.1 emits warnings about function ordering when there isn't a
> problem, which causes Cairo to fail loading images.  Take the patch from
> upstream to fix this.

Any chance of 1.6.1 getting into the release to get the NEON filter fixes?

regards,

Koen

> 
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
> .../libpng/libpng/transform.patch                  |   46 ++++++++++++++++++++
> meta/recipes-multimedia/libpng/libpng_1.6.0.bb     |    2 +-
> 2 files changed, 47 insertions(+), 1 deletion(-)
> create mode 100644 meta/recipes-multimedia/libpng/libpng/transform.patch
> 
> diff --git a/meta/recipes-multimedia/libpng/libpng/transform.patch b/meta/recipes-multimedia/libpng/libpng/transform.patch
> new file mode 100644
> index 0000000..369a2c0
> --- /dev/null
> +++ b/meta/recipes-multimedia/libpng/libpng/transform.patch
> @@ -0,0 +1,46 @@
> +Corrected the test on user transform changes on read. It was in the png_set of
> +the transform function, but that doesn't matter unless the transform function
> +changes the rowbuf size, and that is only valid if transform_info is called.
> +
> +Upstream-Status: Backport (will be in 1.6.2)
> +                 - b44cd59ad9747069b90c6ff0f76558157a61e26a
> +                 - a8715cabd11354da9650dff7c0770686a217b550
> +Signed-off-by: Ross Burton <ross.burton@intel.com>
> +
> +
> +diff --git a/pngrtran.c b/pngrtran.c
> +index 626f3b0..4485e40 100644
> +--- a/pngrtran.c
> ++++ b/pngrtran.c
> +@@ -1056,9 +1056,6 @@ png_set_read_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr
> + {
> +    png_debug(1, "in png_set_read_user_transform_fn");
> + 
> +-   if (!png_rtran_ok(png_ptr, 0))
> +-      return;
> +-
> + #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
> +    png_ptr->transformations |= PNG_USER_TRANSFORM;
> +    png_ptr->read_user_transform_fn = read_user_transform_fn;
> +diff --git a/pngtrans.c b/pngtrans.c
> +index b532172..f822324 100644
> +--- a/pngtrans.c
> ++++ b/pngtrans.c
> +@@ -782,6 +782,17 @@ png_set_user_transform_info(png_structrp png_ptr, png_voidp
> + 
> +    if (png_ptr == NULL)
> +       return;
> ++
> ++#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
> ++   if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
> ++      (png_ptr->flags & PNG_FLAG_ROW_INIT) != 0)
> ++   {
> ++      png_app_error(png_ptr,
> ++            "info change after png_start_read_image or png_read_update_info");
> ++      return;
> ++   }
> ++#endif
> ++
> +    png_ptr->user_transform_ptr = user_transform_ptr;
> +    png_ptr->user_transform_depth = (png_byte)user_transform_depth;
> +    png_ptr->user_transform_channels = (png_byte)user_transform_channels;
> diff --git a/meta/recipes-multimedia/libpng/libpng_1.6.0.bb b/meta/recipes-multimedia/libpng/libpng_1.6.0.bb
> index 951e34a..2353e8d 100644
> --- a/meta/recipes-multimedia/libpng/libpng_1.6.0.bb
> +++ b/meta/recipes-multimedia/libpng/libpng_1.6.0.bb
> @@ -10,7 +10,7 @@ PR = "r0"
> LIBV = "16"
> 
> SRC_URI = "${SOURCEFORGE_MIRROR}/project/libpng/libpng${LIBV}/${PV}/libpng-${PV}.tar.xz \
> -          "
> +           file://transform.patch"
> 
> SRC_URI[md5sum] = "3ee623b9a4d33bda7310a5124080b14d"
> SRC_URI[sha256sum] = "5e13c31321083b03956b5ff298bacffab7a7ad35c34c122acef314593944b97b"
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Ross Burton - April 17, 2013, 1:55 p.m.
On 17 April 2013 14:48, Koen Kooi <koen@dominion.thruhere.net> wrote:
> Any chance of 1.6.1 getting into the release to get the NEON filter fixes?

Not in Dylan, at least not right now.  I'm not going to be entirely
surprised if RP queues these for 1.4.1 as they're not critical, just
doing it right.

Ross

Patch

diff --git a/meta/recipes-multimedia/libpng/libpng/transform.patch b/meta/recipes-multimedia/libpng/libpng/transform.patch
new file mode 100644
index 0000000..369a2c0
--- /dev/null
+++ b/meta/recipes-multimedia/libpng/libpng/transform.patch
@@ -0,0 +1,46 @@ 
+Corrected the test on user transform changes on read. It was in the png_set of
+the transform function, but that doesn't matter unless the transform function
+changes the rowbuf size, and that is only valid if transform_info is called.
+
+Upstream-Status: Backport (will be in 1.6.2)
+                 - b44cd59ad9747069b90c6ff0f76558157a61e26a
+                 - a8715cabd11354da9650dff7c0770686a217b550
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+
+diff --git a/pngrtran.c b/pngrtran.c
+index 626f3b0..4485e40 100644
+--- a/pngrtran.c
++++ b/pngrtran.c
+@@ -1056,9 +1056,6 @@ png_set_read_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr
+ {
+    png_debug(1, "in png_set_read_user_transform_fn");
+ 
+-   if (!png_rtran_ok(png_ptr, 0))
+-      return;
+-
+ #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
+    png_ptr->transformations |= PNG_USER_TRANSFORM;
+    png_ptr->read_user_transform_fn = read_user_transform_fn;
+diff --git a/pngtrans.c b/pngtrans.c
+index b532172..f822324 100644
+--- a/pngtrans.c
++++ b/pngtrans.c
+@@ -782,6 +782,17 @@ png_set_user_transform_info(png_structrp png_ptr, png_voidp
+ 
+    if (png_ptr == NULL)
+       return;
++
++#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
++   if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
++      (png_ptr->flags & PNG_FLAG_ROW_INIT) != 0)
++   {
++      png_app_error(png_ptr,
++            "info change after png_start_read_image or png_read_update_info");
++      return;
++   }
++#endif
++
+    png_ptr->user_transform_ptr = user_transform_ptr;
+    png_ptr->user_transform_depth = (png_byte)user_transform_depth;
+    png_ptr->user_transform_channels = (png_byte)user_transform_channels;
diff --git a/meta/recipes-multimedia/libpng/libpng_1.6.0.bb b/meta/recipes-multimedia/libpng/libpng_1.6.0.bb
index 951e34a..2353e8d 100644
--- a/meta/recipes-multimedia/libpng/libpng_1.6.0.bb
+++ b/meta/recipes-multimedia/libpng/libpng_1.6.0.bb
@@ -10,7 +10,7 @@  PR = "r0"
 LIBV = "16"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/libpng/libpng${LIBV}/${PV}/libpng-${PV}.tar.xz \
-          "
+           file://transform.patch"
 
 SRC_URI[md5sum] = "3ee623b9a4d33bda7310a5124080b14d"
 SRC_URI[sha256sum] = "5e13c31321083b03956b5ff298bacffab7a7ad35c34c122acef314593944b97b"