8028206: sun/java2d/cmm/ProfileOp/SetDataTest.java fails
authorprr
Wed, 13 Nov 2013 11:59:49 -0800
changeset 21589 7bb6e98b1dfb
parent 21533 14f6dddbb916
child 21590 25f549d9b89a
child 21776 31823abc2258
8028206: sun/java2d/cmm/ProfileOp/SetDataTest.java fails Reviewed-by: bae, jchen
jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c
jdk/test/sun/java2d/cmm/ProfileOp/SetDataTest.java
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c	Thu Nov 07 08:16:26 2013 -0800
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c	Wed Nov 13 11:59:49 2013 -0800
@@ -1077,7 +1077,13 @@
 static
 cmsBool SanityCheck(_cmsICCPROFILE* profile)
 {
-    cmsIOHANDLER* io = profile->IOhandler;
+    cmsIOHANDLER* io;
+
+    if (!profile) {
+        return FALSE;
+    }
+
+    io = profile->IOhandler;
     if (!io) {
         return FALSE;
     }
@@ -1108,8 +1114,6 @@
     cmsTagTypeSignature TypeBase;
     cmsTagTypeHandler* TypeHandler;
 
-    if (!SanityCheck(FileOrig)) return FALSE;
-
     for (i=0; i < Icc -> TagCount; i++) {
 
 
@@ -1126,7 +1130,7 @@
 
             // Reach here if we are copying a tag from a disk-based ICC profile which has not been modified by user.
             // In this case a blind copy of the block data is performed
-            if (FileOrig != NULL && Icc -> TagOffsets[i]) {
+            if (SanityCheck(FileOrig) && Icc -> TagOffsets[i]) {
 
                 cmsUInt32Number TagSize   = FileOrig -> TagSizes[i];
                 cmsUInt32Number TagOffset = FileOrig -> TagOffsets[i];
--- a/jdk/test/sun/java2d/cmm/ProfileOp/SetDataTest.java	Thu Nov 07 08:16:26 2013 -0800
+++ b/jdk/test/sun/java2d/cmm/ProfileOp/SetDataTest.java	Wed Nov 13 11:59:49 2013 -0800
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug     7042594
+ * @bug     7042594 8028206
  * @summary Test verifies that ICC_Profile.setData() conforms the spec.
  *
  * @run     main SetDataTest