changeset 10615:d02988beec6a

8067050: Better font consistency checking Reviewed-by: bae, srl, mschoene
author prr
date Thu, 18 Dec 2014 11:19:12 -0800
parents 691af7ed6c3a
children 21256885aaef
files src/share/native/sun/font/layout/LETableReference.h src/share/native/sun/font/layout/LigatureSubstSubtables.cpp
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/font/layout/LETableReference.h	Thu Dec 18 11:19:07 2014 -0800
+++ b/src/share/native/sun/font/layout/LETableReference.h	Thu Dec 18 11:19:12 2014 -0800
@@ -150,8 +150,8 @@
       if(isEmpty()) {
         //err = LE_MISSING_FONT_TABLE_ERROR;
         clear(); // it's just empty. Not an error.
-      } else if(offset >= fParent->fLength) {
-        LE_DEBUG_TR3("offset out of range: (%p) +%d", NULL, offset);
+      } else if(offset >= fParent->fLength || (offset & 0x01)) {
+        LE_DEBUG_TR3("offset out of range or odd alignment: (%p) +%d", NULL, offset);
         err = LE_INDEX_OUT_OF_BOUNDS_ERROR;
         clear();
       } else {
--- a/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp	Thu Dec 18 11:19:07 2014 -0800
+++ b/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp	Thu Dec 18 11:19:12 2014 -0800
@@ -58,7 +58,7 @@
         if( LE_FAILURE(success) ) { return 0; }
         le_uint16 ligCount = SWAPW(ligSetTable->ligatureCount);
 
-        LEReferenceTo<Offset> ligatureTableOffsetArray(base, success, ligSetTable->ligatureTableOffsetArray, ligCount);
+        LEReferenceToArrayOf<Offset> ligatureTableOffsetArray(base, success, ligSetTable->ligatureTableOffsetArray, ligCount);
         for (le_uint16 lig = 0; LE_SUCCESS(success) && lig < ligCount; lig += 1) {
             Offset ligTableOffset = SWAPW(ligSetTable->ligatureTableOffsetArray[lig]);
             LEReferenceTo<LigatureTable>   ligTable(ligSetTable, success, ligTableOffset);