changeset 35299:d5737dedc6df

8145551: Test failed with Crash for Improved font lookups Reviewed-by: prr, vadim
author aivanov
date Tue, 22 Dec 2015 09:50:09 +0300
parents 9f93cbce8c44
children 30eaec7fded0
files jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp jdk/src/java.desktop/share/native/libfontmanager/layout/Lookups.cpp
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp	Tue Dec 15 12:59:00 2015 +0000
+++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/Features.cpp	Tue Dec 22 09:50:09 2015 +0300
@@ -43,9 +43,10 @@
     LEReferenceToArrayOf<FeatureRecord>
         featureRecordArrayRef(base, success, featureRecordArray, SWAPW(featureCount));
 
-  if (featureIndex >= SWAPW(featureCount) || LE_FAILURE(success)) {
-    return LEReferenceTo<FeatureTable>();
-  }
+    if (featureIndex >= SWAPW(featureCount) || LE_FAILURE(success)) {
+        success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+        return LEReferenceTo<FeatureTable>();
+    }
 
     Offset featureTableOffset = featureRecordArray[featureIndex].featureTableOffset;
 
--- a/jdk/src/java.desktop/share/native/libfontmanager/layout/Lookups.cpp	Tue Dec 15 12:59:00 2015 +0000
+++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/Lookups.cpp	Tue Dec 22 09:50:09 2015 +0300
@@ -42,6 +42,7 @@
   LEReferenceToArrayOf<Offset> lookupTableOffsetArrayRef(base, success, (const Offset*)&lookupTableOffsetArray, SWAPW(lookupCount));
 
   if(LE_FAILURE(success) || lookupTableIndex>lookupTableOffsetArrayRef.getCount()) {
+    success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
     return LEReferenceTo<LookupTable>();
   } else {
     return LEReferenceTo<LookupTable>(base, success, SWAPW(lookupTableOffsetArrayRef.getObject(lookupTableIndex, success)));
@@ -53,6 +54,7 @@
   LEReferenceToArrayOf<Offset> subTableOffsetArrayRef(base, success, (const Offset*)&subTableOffsetArray, SWAPW(subTableCount));
 
   if(LE_FAILURE(success) || subtableIndex>subTableOffsetArrayRef.getCount()) {
+    success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
     return LEReferenceTo<LookupSubtable>();
   } else {
     return LEReferenceTo<LookupSubtable>(base, success, SWAPW(subTableOffsetArrayRef.getObject(subtableIndex, success)));