changeset 9154:93a6bf73d3d0 8u51-b03

Automated merge with http://closedjdk.us.oracle.com/openjfx/8u45/rt
author kcr
date Fri, 06 Mar 2015 09:57:54 -0800
parents a29d15931c16 6b13c6d79851
children 21415d17d158 7920958b08e6
files .hgtags
diffstat 3 files changed, 34 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Mar 04 13:48:36 2015 -0700
+++ b/.hgtags	Fri Mar 06 09:57:54 2015 -0800
@@ -238,5 +238,7 @@
 eb272f8584c8346d7438e2b23d0661980d512c07 8u45-b07
 6cc08ec1ea825b4bd1273e522e61e1b9efda4172 8u40-b25
 9a0bb4610ea0e3fe93008c8ddf2757fdb9c3be35 8u45-b08
+d488fa8851887680a690803f28112ed0a0776e53 8u51-b01
 88882082520b7195b4e669955782ffc6757db7ac 8u45-b09
+1a31f06296ebb5d60cc22fe43420e430d6ecba61 8u51-b02
 f5b6e9bfedc64c3bc27d1fdd8888f5386b9c9f36 8u45-b10
--- a/build.properties	Wed Mar 04 13:48:36 2015 -0700
+++ b/build.properties	Fri Mar 06 09:57:54 2015 -0800
@@ -30,13 +30,13 @@
 ##############################################################################
 
 # Note: The expected value for milestone are [alpha, beta, dev, ea, fcs]
-jfx.release.milestone=fcs
+jfx.release.milestone=ea
 # Note: For fcs builds the suffix should be blank
-jfx.release.suffix=
-jfx.release.name=8u45
+jfx.release.suffix=-ea
+jfx.release.name=8u51
 jfx.release.major.version=8
 jfx.release.minor.version=0
-jfx.release.micro.version=45
+jfx.release.micro.version=51
 
 ##############################################################################
 #
--- a/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java	Wed Mar 04 13:48:36 2015 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java	Fri Mar 06 09:57:54 2015 -0800
@@ -512,6 +512,9 @@
 
             setStyle();
 
+            // sanity check the cmap table
+            checkCMAP();
+
             /* Get names last, as the name table is far from the file header.
              * Although its also likely too big to fit in the read cache
              * in which case that would remain valid, but also will help
@@ -824,6 +827,31 @@
         }
     }
 
+    private void checkCMAP() throws Exception {
+        DirectoryEntry cmapDE = getDirectoryEntry(FontConstants.cmapTag);
+        if (cmapDE != null) {
+            if (cmapDE.length < 4) {
+                throw new Exception("Invalid cmap table length");
+            }
+            Buffer cmapTableHeader = filereader.readBlock(cmapDE.offset, 4);
+            short version = cmapTableHeader.getShort();
+            short numberSubTables = cmapTableHeader.getShort();
+            int indexLength = numberSubTables * 8;
+            if (numberSubTables <= 0 || cmapDE.length < indexLength + 4) {
+                throw new Exception("Invalid cmap subtables count");
+            }
+            Buffer cmapTableIndex = filereader.readBlock(cmapDE.offset + 4, indexLength);
+            for (int i = 0; i < numberSubTables; i++) {
+                short platformID = cmapTableIndex.getShort();
+                short encodingID = cmapTableIndex.getShort();
+                int offset = cmapTableIndex.getInt();
+                if (offset < 0 || offset >= cmapDE.length) {
+                    throw new Exception("Invalid cmap subtable offset");
+                }
+            }
+        }
+    }
+    
     /*** BEGIN LOCALE_ID MAPPING ****/
 
     private static Map<String, Short> lcidMap;