changeset 8190:f8df2adc5288

8067050: Better font consistency checking Reviewed-by: prr
author bae
date Thu, 15 Jan 2015 22:32:19 +0400
parents c8ccd3da3a10
children ba96d0ec6859
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 Jan 15 22:22:24 2015 +0400
+++ b/src/share/native/sun/font/layout/LETableReference.h	Thu Jan 15 22:32:19 2015 +0400
@@ -151,8 +151,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 Jan 15 22:22:24 2015 +0400
+++ b/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp	Thu Jan 15 22:32:19 2015 +0400
@@ -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);