From f81c4845ccac7e3e2b1075b4abcb4008bedf5fae Mon Sep 17 00:00:00 2001 From: Tilman Hausherr Date: Sun, 13 Aug 2023 19:15:55 +0000 Subject: [PATCH] PDFBOX-5652: avoid IllegalArgumentException and skip instead git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1911629 13f79535-47bb-0310-9956-ffa450edef68 --- .../fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java b/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java index b4a15dda796..c6da65ac09e 100644 --- a/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java +++ b/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java @@ -220,8 +220,8 @@ private void extractDataFromSingleSubstTableFormat2Table( if (coverageTable.getSize() != singleSubstTableFormat2.getSubstituteGlyphIDs().length) { - throw new IllegalArgumentException( - "The no. coverage table entries should be the same as the size of the substituteGlyphIDs"); + LOG.warn("The no. coverage table entries should be the same as the size of the substituteGlyphIDs"); + return; } for (int i = 0; i < coverageTable.getSize(); i++) @@ -242,8 +242,8 @@ private void extractDataFromMultipleSubstitutionFormat1Table( if (coverageTable.getSize() != multipleSubstFormat1Subtable.getSequenceTables().length) { - throw new IllegalArgumentException( - "The no. coverage table entries should be the same as the size of the sequencce tables"); + LOG.warn("The no. coverage table entries should be the same as the size of the sequencce tables"); + return; } for (int i = 0; i < coverageTable.getSize(); i++)