Mercurial > hg > release > icedtea7-forest-2.3 > jdk
changeset 6338:210b6fac668a
8013514: Improve stability of cmap class
Reviewed-by: mschoene, prr, bae
author | vadim |
---|---|
date | Mon, 13 May 2013 13:24:30 +0400 |
parents | 6b7e8dc5bf84 |
children | 12a88f98c1f9 |
files | src/share/classes/sun/font/FileFont.java src/share/classes/sun/font/StandardGlyphVector.java src/share/classes/sun/font/TrueTypeFont.java |
diffstat | 3 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/sun/font/FileFont.java Thu May 09 11:23:18 2013 -0700 +++ b/src/share/classes/sun/font/FileFont.java Mon May 13 13:24:30 2013 +0400 @@ -170,7 +170,9 @@ } } } - scaler.dispose(); + if (scaler != null) { + scaler.dispose(); + } scaler = FontScaler.getNullScaler(); }
--- a/src/share/classes/sun/font/StandardGlyphVector.java Thu May 09 11:23:18 2013 -0700 +++ b/src/share/classes/sun/font/StandardGlyphVector.java Mon May 13 13:24:30 2013 +0400 @@ -1740,8 +1740,9 @@ 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); }
--- a/src/share/classes/sun/font/TrueTypeFont.java Thu May 09 11:23:18 2013 -0700 +++ b/src/share/classes/sun/font/TrueTypeFont.java Mon May 13 13:24:30 2013 +0400 @@ -1037,6 +1037,9 @@ 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);