changeset 1514:c1ab3276c070

2009-05-08 Andrew Haley <aph@redhat.com> * patches/icedtea-lcms-2.patch: Work around lcms breakage. See https://bugs.openjdk.java.net/show_bug.cgi?id=100050
author aph
date Fri, 08 May 2009 14:36:10 +0100
parents 934d7b595b32
children a26c92de857f
files ChangeLog Makefile.am patches/icedtea-lcms-2.patch
diffstat 3 files changed, 61 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 08 11:24:32 2009 +0100
+++ b/ChangeLog	Fri May 08 14:36:10 2009 +0100
@@ -1,3 +1,8 @@
+2009-05-08  Andrew Haley  <aph@redhat.com>
+
+	* patches/icedtea-lcms-2.patch: Work around lcms breakage.  See
+	https://bugs.openjdk.java.net/show_bug.cgi?id=100050
+
 2009-05-08  Gary Benson  <gbenson@redhat.com>
 
 	* Makefile.am: Removed patches and logic for building Zero and
--- a/Makefile.am	Fri May 08 11:24:32 2009 +0100
+++ b/Makefile.am	Fri May 08 14:36:10 2009 +0100
@@ -529,6 +529,7 @@
 	patches/icedtea-core-build.patch \
 	patches/icedtea-jvmtiEnv.patch \
 	patches/icedtea-lcms.patch \
+	patches/icedtea-lcms-2.patch \
 	patches/hotspot/$(HSBUILD)/icedtea-core-build.patch \
 	patches/icedtea-linker-options.patch \
 	patches/hotspot/$(HSBUILD)/icedtea-static-libstdc++.patch \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-lcms-2.patch	Fri May 08 14:36:10 2009 +0100
@@ -0,0 +1,55 @@
+2009-05-08  Andrew Haley  <aph@redhat.com>
+
+	* openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c: Work
+	around lcms breakage.  See
+	https://bugs.openjdk.java.net/show_bug.cgi?id=100050
+
+--- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c~	2009-04-24 08:34:31.000000000 +0100
++++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c	2009-05-07 19:11:37.000000000 +0100
+@@ -610,14 +610,19 @@
+         return FALSE;
+     }
+ 
+-    if (!Icc->Grow(Icc, delta)) {
+-        free(ptr);
+-        if(isNew) {
+-            Icc->TagCount--;
+-        }
+-        J2dRlsTraceLn(J2D_TRACE_ERROR,
+-                      "_cmsModifyTagData: Icc->Grow() == FALSE");
+-        return FALSE;
++    /* We change the size of Icc here only if we know it'll actually
++     * grow: if Icc is about to shrink we must wait until we've read
++     * the previous data.  */
++    if (delta > 0) {
++	if (!Icc->Grow(Icc, delta)) {
++	    free(ptr);
++	    if(isNew) {
++		Icc->TagCount--;
++	    }
++	    J2dRlsTraceLn(J2D_TRACE_ERROR,
++			  "_cmsModifyTagData: Icc->Grow() == FALSE");
++	    return FALSE;
++	}
+     }
+ 
+     /* Compute size of tag data before/after the modified tag */
+@@ -680,6 +685,18 @@
+     temp = TransportValue32(profileSize);
+     Icc->Write(Icc, sizeof(icUInt32Number), &temp);
+ 
++    /* Shrink Icc, if needed.  */
++    if (delta < 0) {
++	if (!Icc->Grow(Icc, delta)) {
++	    free(ptr);
++	    if(isNew) {
++		Icc->TagCount--;
++	    }
++	    J2dRlsTraceLn(J2D_TRACE_ERROR,
++			  "_cmsModifyTagData: Icc->Grow() == FALSE");
++	    return FALSE;
++	}
++    }
+ 
+     /* Adjust tag offsets: if the tag is new, we must account
+        for the new tag table entry; otherwise, only those tags after