8074335: Substitute for substitution formats
authorvadim
Tue, 07 Apr 2015 13:37:30 +0300
changeset 31697 3b1fe217d0b0
parent 31696 9130242e6cfb
child 31698 9dbc80b20ac6
8074335: Substitute for substitution formats Reviewed-by: prr, srl, mschoene
jdk/src/java.desktop/share/native/libfontmanager/layout/SingleSubstitutionSubtables.cpp
--- a/jdk/src/java.desktop/share/native/libfontmanager/layout/SingleSubstitutionSubtables.cpp	Mon Apr 06 15:54:29 2015 -0700
+++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/SingleSubstitutionSubtables.cpp	Tue Apr 07 13:37:30 2015 +0300
@@ -94,7 +94,9 @@
         return 0;
     }
 
-    if (coverageIndex >= 0) {
+    LEReferenceToArrayOf<TTGlyphID> substituteArrayRef(base, success, substituteArray, SWAPW(glyphCount));
+
+    if (coverageIndex >= 0 && LE_SUCCESS(success) && coverageIndex < substituteArrayRef.getCount()) {
         TTGlyphID substitute = SWAPW(substituteArray[coverageIndex]);
 
         if (filter == NULL || filter->accept(LE_SET_GLYPH(glyph, substitute), success)) {