diff --git a/src/share/native/sun/font/layout/CanonShaping.cpp b/src/share/native/sun/font/layout/CanonShaping.cpp index 86f2ebc89c1f1b6b55c719ba6b747622894787fc..be011b10f37548598f136f0bee055a163d1aa5fb 100644 --- a/src/share/native/sun/font/layout/CanonShaping.cpp +++ b/src/share/native/sun/font/layout/CanonShaping.cpp @@ -66,6 +66,16 @@ void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount, le le_int32 *indices = LE_NEW_ARRAY(le_int32, charCount); le_int32 i; + if (combiningClasses == NULL || indices == NULL) { + if (combiningClasses != NULL) { + LE_DELETE_ARRAY(combiningClasses); + } + if (indices != NULL) { + LE_DELETE_ARRAY(indices); + } + return; + } + for (i = 0; i < charCount; i += 1) { combiningClasses[i] = classTable->getGlyphClass(classTable, (LEGlyphID) inChars[i], success); indices[i] = i;