diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/LETableReference.h b/jdk/src/java.desktop/share/native/libfontmanager/layout/LETableReference.h index 6afd3c1c13b..459d4e08806 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/LETableReference.h +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/LETableReference.h @@ -150,8 +150,8 @@ public: 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 { diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/LigatureSubstSubtables.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/LigatureSubstSubtables.cpp index 8e0e7cdd2b8..55209409578 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/LigatureSubstSubtables.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/LigatureSubstSubtables.cpp @@ -58,7 +58,7 @@ le_uint32 LigatureSubstitutionSubtable::process(const LETableReference &base, Gl if( LE_FAILURE(success) ) { return 0; } le_uint16 ligCount = SWAPW(ligSetTable->ligatureCount); - LEReferenceTo ligatureTableOffsetArray(base, success, ligSetTable->ligatureTableOffsetArray, ligCount); + LEReferenceToArrayOf 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 ligTable(ligSetTable, success, ligTableOffset);