Bug 100050 - lcms 1.18 update breaks ICC_ProfileRGB Tests

Andrew Haley aph at redhat.com
Fri May 8 04:37:07 PDT 2009


Colour management is broken at the moment because the import of the
latest OpenJDK 6 contains a new version of lcms that is buggy.

I've written a patch to fix this, and Sun are looking at it.  In the
meantime I propose to patch IcedTea as a temporary workaround.

OK?

Andrew.



--- LCMS.c~	2009-04-24 08:34:31.000000000 +0100
+++ 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



More information about the distro-pkg-dev mailing list