8042855: [parfait] Potential null pointer dereference in IndicLayoutEngine.cpp
Reviewed-by: bae, srl
--- a/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp Thu May 22 21:05:30 2014 +0400
+++ b/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp Thu May 22 13:54:08 2014 -0700
@@ -151,7 +151,7 @@
le_int32 outCharCount;
if (fVersion2) {
_LETRACE("v2process");
- outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage);
+ outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage, success);
} else {
_LETRACE("reorder");
outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups, success);
--- a/jdk/src/share/native/sun/font/layout/IndicReordering.cpp Thu May 22 21:05:30 2014 +0400
+++ b/jdk/src/share/native/sun/font/layout/IndicReordering.cpp Thu May 22 13:54:08 2014 -0700
@@ -1096,9 +1096,13 @@
le_int32 IndicReordering::v2process(const LEUnicode *chars, le_int32 charCount, le_int32 scriptCode,
- LEUnicode *outChars, LEGlyphStorage &glyphStorage)
+ LEUnicode *outChars, LEGlyphStorage &glyphStorage, LEErrorCode& success)
{
const IndicClassTable *classTable = IndicClassTable::getScriptClassTable(scriptCode);
+ if (classTable == NULL) {
+ success = LE_MEMORY_ALLOCATION_ERROR;
+ return 0;
+ }
DynamicProperties dynProps[INDIC_BLOCK_SIZE];
IndicReordering::getDynamicProperties(dynProps,classTable);
--- a/jdk/src/share/native/sun/font/layout/IndicReordering.h Thu May 22 21:05:30 2014 +0400
+++ b/jdk/src/share/native/sun/font/layout/IndicReordering.h Thu May 22 13:54:08 2014 -0700
@@ -181,7 +181,7 @@
static void adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage, LEErrorCode& success);
static le_int32 v2process(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode,
- LEUnicode *outChars, LEGlyphStorage &glyphStorage);
+ LEUnicode *outChars, LEGlyphStorage &glyphStorage, LEErrorCode& success);
static const FeatureMap *getFeatureMap(le_int32 &count);