8020293: JVM crash

Reviewed-by: prr, jgodinez
This commit is contained in:
Johnny Chen 2013-07-24 12:03:57 -07:00
parent 2fac55ced5
commit 99860de3cd
2 changed files with 8 additions and 3 deletions

View File

@ -468,9 +468,10 @@ public final class GlyphLayout {
_gvdata.grow(); _gvdata.grow();
} }
} }
if (_gvdata._count < 0) { }
break; // Break out of the outer for loop if layout fails.
} if (_gvdata._count < 0) {
break;
} }
} }

View File

@ -104,6 +104,10 @@ Java_sun_font_SunLayoutEngine_initGVIDs
int putGV(JNIEnv* env, jint gmask, jint baseIndex, jobject gvdata, const LayoutEngine* engine, int glyphCount) { int putGV(JNIEnv* env, jint gmask, jint baseIndex, jobject gvdata, const LayoutEngine* engine, int glyphCount) {
int count = env->GetIntField(gvdata, gvdCountFID); int count = env->GetIntField(gvdata, gvdCountFID);
if (count < 0) {
JNU_ThrowInternalError(env, "count negative");
return 0;
}
jarray glyphArray = (jarray)env->GetObjectField(gvdata, gvdGlyphsFID); jarray glyphArray = (jarray)env->GetObjectField(gvdata, gvdGlyphsFID);
if (IS_NULL(glyphArray)) { if (IS_NULL(glyphArray)) {