changeset 6457:aeb96dec1c6b

Merge
author lana
date Tue, 23 Oct 2012 09:38:38 -0700
parents 1ae6420126af 117eed515e42
children 37a6ead4a357
files
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Thu Oct 18 11:09:00 2012 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Tue Oct 23 09:38:38 2012 -0700
@@ -253,6 +253,16 @@
 
     if (sProf.pf == NULL) {
         JNU_ThrowIllegalArgumentException(env, "Invalid profile data");
+    } else {
+        /* Sanity check: try to save the profile in order
+         * to force basic validation.
+         */
+        cmsUInt32Number pfSize = 0;
+        if (!cmsSaveProfileToMem(sProf.pf, NULL, &pfSize) ||
+            pfSize < sizeof(cmsICCHeader))
+        {
+            JNU_ThrowIllegalArgumentException(env, "Invalid profile data");
+        }
     }
 
     return sProf.j;