7141914: Draw glyph cause JVM crash
Reviewed-by: bae, igor
This commit is contained in:
parent
d1e88d085e
commit
80e0df803f
@ -163,7 +163,9 @@ public abstract class FileFont extends PhysicalFont {
|
||||
}
|
||||
}
|
||||
}
|
||||
scaler.dispose();
|
||||
if (scaler != null) {
|
||||
scaler.dispose();
|
||||
}
|
||||
scaler = FontScaler.getNullScaler();
|
||||
}
|
||||
|
||||
|
@ -1740,8 +1740,9 @@ public class StandardGlyphVector extends GlyphVector {
|
||||
tx,
|
||||
sgv.font.getStyle(),
|
||||
aa, fm);
|
||||
|
||||
FontStrike strike = sgv.font2D.getStrike(desc); // !!! getStrike(desc, false)
|
||||
// Get the strike via the handle. Shouldn't matter
|
||||
// if we've invalidated the font but its an extra precaution.
|
||||
FontStrike strike = sgv.font2D.handle.font2D.getStrike(desc); // !!! getStrike(desc, false)
|
||||
|
||||
return new GlyphStrike(sgv, strike, dx, dy);
|
||||
}
|
||||
|
@ -2619,6 +2619,9 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
|
||||
physicalFonts.remove(oldFont.fullName);
|
||||
fullNameToFont.remove(oldFont.fullName.toLowerCase(Locale.ENGLISH));
|
||||
FontFamily.remove(oldFont);
|
||||
if (oldFont instanceof FileFont) {
|
||||
((FileFont)oldFont).deregisterFontAndClearStrikeCache();
|
||||
}
|
||||
|
||||
if (localeFullNamesToFont != null) {
|
||||
Map.Entry[] mapEntries =
|
||||
|
@ -1037,6 +1037,9 @@ public class TrueTypeFont extends FileFont {
|
||||
if (head_Table != null && head_Table.capacity() >= 18) {
|
||||
ShortBuffer sb = head_Table.asShortBuffer();
|
||||
upem = sb.get(9) & 0xffff;
|
||||
if (upem < 16 || upem > 16384) {
|
||||
upem = 2048;
|
||||
}
|
||||
}
|
||||
|
||||
ByteBuffer os2_Table = getTableBuffer(os_2Tag);
|
||||
|
Loading…
Reference in New Issue
Block a user