--- a/jdk/src/share/classes/sun/font/GlyphLayout.java Wed Jul 17 18:46:00 2013 +0800
+++ b/jdk/src/share/classes/sun/font/GlyphLayout.java Wed Jul 24 12:03:57 2013 -0700
@@ -468,9 +468,10 @@
_gvdata.grow();
}
}
- if (_gvdata._count < 0) {
- break;
- }
+ }
+ // Break out of the outer for loop if layout fails.
+ if (_gvdata._count < 0) {
+ break;
}
}
--- a/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp Wed Jul 17 18:46:00 2013 +0800
+++ b/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp Wed Jul 24 12:03:57 2013 -0700
@@ -104,6 +104,10 @@
int putGV(JNIEnv* env, jint gmask, jint baseIndex, jobject gvdata, const LayoutEngine* engine, int glyphCount) {
int count = env->GetIntField(gvdata, gvdCountFID);
+ if (count < 0) {
+ JNU_ThrowInternalError(env, "count negative");
+ return 0;
+ }
jarray glyphArray = (jarray)env->GetObjectField(gvdata, gvdGlyphsFID);
if (IS_NULL(glyphArray)) {