From 3e4af8681be3c63d8f1b647fa07d6fa06a78558a Mon Sep 17 00:00:00 2001 From: franz Date: Sat, 30 May 2026 15:24:32 +0200 Subject: [PATCH] GH-492 parsing of cssProperty font-size with numeric-only value causes StringIndexOutOfBoundsException --- .../icepdf/core/pobjects/annotations/FreeTextAnnotation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core-awt/src/main/java/org/icepdf/core/pobjects/annotations/FreeTextAnnotation.java b/core/core-awt/src/main/java/org/icepdf/core/pobjects/annotations/FreeTextAnnotation.java index 347eb4976..943a96af1 100644 --- a/core/core-awt/src/main/java/org/icepdf/core/pobjects/annotations/FreeTextAnnotation.java +++ b/core/core-awt/src/main/java/org/icepdf/core/pobjects/annotations/FreeTextAnnotation.java @@ -645,7 +645,7 @@ private void parseDefaultStylingString() { } } else if (cssProperty != null && cssProperty.contains("font-size")) { String fontSize = cssProperty.substring(cssProperty.indexOf(":") + 1).trim(); - fontSize = fontSize.substring(0, fontSize.indexOf('p')); + fontSize = fontSize.replaceFirst(".*?(\\d+).*", "$1"); try { this.fontSize = (int) Float.parseFloat(fontSize); } catch (NumberFormatException e) {