changeset 8871:95cd10d8f97c

8219020: Table alternate substitutions Reviewed-by: mbalao
author bae
date Wed, 10 Jul 2019 18:21:59 +0100
parents 2f920c764013
children b096b7c13580
files src/share/native/sun/font/layout/AlternateSubstSubtables.cpp
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp	Wed Jun 19 19:07:08 2019 +0300
+++ b/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp	Wed Jul 10 18:21:59 2019 +0100
@@ -50,7 +50,13 @@
         le_uint16 altSetCount = SWAPW(alternateSetCount);
 
         if (coverageIndex < altSetCount) {
-            Offset alternateSetTableOffset = SWAPW(alternateSetTableOffsetArray[coverageIndex]);
+            const LEReferenceToArrayOf<Offset>
+                arrayRef(base, success, alternateSetTableOffsetArray, altSetCount);
+            if (!LE_SUCCESS(success)) return 0;
+
+            Offset alternateSetTableOffset = SWAPW(arrayRef.getObject(coverageIndex, success));
+            if (!LE_SUCCESS(success)) return 0;
+
             const LEReferenceTo<AlternateSetTable> alternateSetTable(base, success,
                                   (const AlternateSetTable *) ((char *) this + alternateSetTableOffset));
             if (!LE_SUCCESS(success)) return 0;