From 06202b86935e8e3cfc945a1e1de8efe8c18fba0b Mon Sep 17 00:00:00 2001 From: Dmitrii Morskii Date: Wed, 23 Oct 2024 15:06:05 +0100 Subject: [PATCH] JBR-7302 added additional emptiness check in getGlyphOutlineBounds (cherry picked from commit 07943285048dda79d021289b97d06880fae4cf4b) --- .../share/classes/sun/font/StandardGlyphVector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java b/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java index 48ae55603d49..66dfbc909453 100644 --- a/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java +++ b/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java @@ -1798,9 +1798,9 @@ Rectangle2D getGlyphOutlineBounds(int glyphID, float x, float y) { result = new Rectangle2D.Float(); result.setRect(strike.getGlyphOutlineBounds(glyphID)); // don't mutate cached rect } else { - if (sgv.invdtx.getShearX() == 0 && sgv.invdtx.getShearY() == 0 && + final Rectangle2D.Float rect = strike.getGlyphOutlineBounds(glyphID); + if (!rect.isEmpty() && sgv.invdtx.getShearX() == 0 && sgv.invdtx.getShearY() == 0 && sgv.invdtx.getScaleX() > 0 && sgv.invdtx.getScaleY() > 0) { - final Rectangle2D.Float rect = strike.getGlyphOutlineBounds(glyphID); result = new Rectangle2D.Float( (float)(rect.x*sgv.invdtx.getScaleX() + sgv.invdtx.getTranslateX()), (float)(rect.y*sgv.invdtx.getScaleY() + sgv.invdtx.getTranslateY()),