8009013: Better handling of T2K glyphs
Reviewed-by: bae, mschoene, prr
This commit is contained in:
parent
0244671a23
commit
33af6236b8
@ -1351,17 +1351,22 @@ Java_sun_font_FreetypeFontScaler_getGlyphVectorOutlineNative(
|
||||
FTScalerInfo *scalerInfo =
|
||||
(FTScalerInfo*) jlong_to_ptr(pScaler);
|
||||
|
||||
glyphs = NULL;
|
||||
if (numGlyphs > 0 && 0xffffffffu / sizeof(jint) >= numGlyphs) {
|
||||
glyphs = (jint*) malloc(numGlyphs*sizeof(jint));
|
||||
if (glyphs == NULL) {
|
||||
gp = (*env)->NewObject(env, sunFontIDs.gpClass, sunFontIDs.gpCtrEmpty);
|
||||
if (!isNullScalerContext(context) && scalerInfo != NULL) {
|
||||
invalidateJavaScaler(env, scaler, scalerInfo);
|
||||
}
|
||||
if (glyphs == NULL) {
|
||||
// We reach here if:
|
||||
// 1. numGlyphs <= 0,
|
||||
// 2. overflow check failed, or
|
||||
// 3. malloc failed.
|
||||
gp = (*env)->NewObject(env, sunFontIDs.gpClass, sunFontIDs.gpCtrEmpty);
|
||||
return gp;
|
||||
}
|
||||
|
||||
(*env)->GetIntArrayRegion(env, glyphArray, 0, numGlyphs, glyphs);
|
||||
|
||||
gpdata.numCoords = 0;
|
||||
for (i=0; i<numGlyphs;i++) {
|
||||
if (glyphs[i] >= INVISIBLE_GLYPHS) {
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user