You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2024/05/09 07:42:09 UTC
svn commit: r1917592 - /pdfbox/branches/3.0/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
Author: tilman
Date: Thu May 9 07:42:09 2024
New Revision: 1917592
URL: http://svn.apache.org/viewvc?rev=1917592&view=rev
Log:
PDFBOX-5817: detect extreme componentCount value
Modified:
pdfbox/branches/3.0/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
Modified: pdfbox/branches/3.0/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/3.0/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java?rev=1917592&r1=1917591&r2=1917592&view=diff
==============================================================================
--- pdfbox/branches/3.0/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java (original)
+++ pdfbox/branches/3.0/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java Thu May 9 07:42:09 2024
@@ -589,6 +589,11 @@ public class GlyphSubstitutionTable exte
int ligatureGlyph = data.readUnsignedShort();
int componentCount = data.readUnsignedShort();
+ if (componentCount > 100)
+ {
+ throw new IOException("componentCount in ligature table is " +
+ componentCount + ", font likely corrupt");
+ }
int[] componentGlyphIDs = new int[componentCount];