jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp
changeset 23909 1ba74cd2a357
parent 22330 cafb826672bd
--- a/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp	Mon Dec 16 09:26:47 2013 -0800
+++ b/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp	Mon Jan 13 14:53:06 2014 -0800
@@ -95,7 +95,7 @@
 
     if (actionOffset != 0) {
         LEReferenceTo<LigatureActionEntry> ap(stHeader, success, ligActionOffset); // byte offset
-        ap.addObject(ligActionIndex - 1, success);  // index offset ( one before the actual start, because we will pre-increment)
+        ap.addObject(ligActionIndex, success);
         LEReferenceToArrayOf<TTGlyphID> ligatureTable(stHeader, success, ligatureOffset, LE_UNBOUNDED_ARRAY);
         LigatureActionEntry action;
         le_int32 offset, i = 0;
@@ -111,7 +111,6 @@
         do {
             le_uint32 componentGlyph = componentStack[m--]; // pop off
 
-            ap.addObject(success);
             action = SWAPL(*ap.getAlias());
 
             if (m < 0) {
@@ -145,7 +144,8 @@
               LE_DEBUG_BAD_FONT("m<0")
             }
 #endif
-        } while (!(action & lafLast) && (m>=0) ); // stop if last bit is set, or if run out of items
+            ap.addObject(success);
+        } while (LE_SUCCESS(success) && !(action & lafLast) && (m>=0) ); // stop if last bit is set, or if run out of items
 
         while (mm >= 0) {
             if (++m >= nComponents) {