changeset 5774:8ee038c2b068

RT-34094: Crash on MacOS 10.9 in Java_com_sun_t2k_T2KFontFile_getGlyphBoundingBoxNative Reviewed-by: fheidric
author vadim
date Thu, 21 Nov 2013 13:29:46 +0400
parents 0f04095e0841
children bc53d6e4e696
files modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java	Wed Nov 20 17:37:19 2013 -0800
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java	Thu Nov 21 13:29:46 2013 +0400
@@ -427,8 +427,7 @@
 
             filesize = (int)filereader.getLength();
             int headerOffset = 0;
-            switch (sfntTag) {
-            case ttcfTag:
+            if (sfntTag == ttcfTag) {
                 buffer.getInt(); // skip TTC version ID
                 directoryCount = buffer.getInt();
                 if (fIndex >= directoryCount) {
@@ -437,8 +436,11 @@
                 fontIndex = fIndex;
                 buffer = filereader.readBlock(TTCHEADERSIZE+4*fIndex, 4);
                 headerOffset = buffer.getInt();
-                break;
+                buffer = filereader.readBlock(headerOffset, 4);
+                sfntTag = buffer.getInt();
+            }
 
+            switch (sfntTag) {
             case v1ttTag:
             case trueTag:
                 break;