view patches/security/20140114/8025034-layout_lookups.patch @ 3035:c802218a85b1

Add 2014-01-14 CPU fixes
author Omair Majid <omajid@redhat.com>
date Tue, 14 Jan 2014 14:58:29 -0500
parents
children
line wrap: on
line source

# HG changeset patch
# User vadim
# Date 1379609780 -14400
#      Thu Sep 19 20:56:20 2013 +0400
# Node ID 31735865b718fa6d8bf6950158a3d09d7613b21a
# Parent  1e92cb43dce5042f47d8500057396ff48ab4e143
8025034: Improve layout lookups
Reviewed-by: mschoene, vadim, srl

diff -Nru openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp
--- openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp
+++ openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp
@@ -138,7 +138,7 @@
 le_int32 LookupProcessor::selectLookups(const LEReferenceTo<FeatureTable> &featureTable, FeatureMask featureMask, le_int32 order, LEErrorCode &success)
 {
     le_uint16 lookupCount = featureTable.isValid()? SWAPW(featureTable->lookupCount) : 0;
-    le_int32  store = order;
+    le_uint32  store = (le_uint32)order;
 
     LEReferenceToArrayOf<le_uint16> lookupListIndexArray(featureTable, success, featureTable->lookupListIndexArray, lookupCount);
 
@@ -147,6 +147,9 @@
       if (lookupListIndex >= lookupSelectCount) {
         continue;
       }
+      if (store >= lookupOrderCount) {
+        continue;
+      }
 
       lookupSelectArray[lookupListIndex] |= featureMask;
       lookupOrderArray[store++] = lookupListIndex;
@@ -246,7 +249,7 @@
 
     if (requiredFeatureIndex != 0xFFFF) {
       requiredFeatureTable = featureListTable->getFeatureTable(featureListTable, requiredFeatureIndex, &requiredFeatureTag, success);
-      featureReferences += SWAPW(featureTable->lookupCount);
+      featureReferences += SWAPW(requiredFeatureTable->lookupCount);
     }
 
     lookupOrderArray = LE_NEW_ARRAY(le_uint16, featureReferences);
@@ -254,6 +257,7 @@
         success = LE_MEMORY_ALLOCATION_ERROR;
         return;
     }
+    lookupOrderCount = featureReferences;
 
     for (le_int32 f = 0; f < featureMapCount; f += 1) {
         FeatureMap fm = featureMap[f];