Merge
authorlana
Thu, 14 Nov 2013 23:29:18 -0800
changeset 21590 25f549d9b89a
parent 21588 b380be353729 (current diff)
parent 21589 7bb6e98b1dfb (diff)
child 21600 48d56047f54d
Merge
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c	Thu Nov 14 09:05:14 2013 -0800
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c	Thu Nov 14 23:29:18 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 14 09:05:14 2013 -0800
+++ b/jdk/test/sun/java2d/cmm/ProfileOp/SetDataTest.java	Thu Nov 14 23:29:18 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