You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2022/01/26 07:28:28 UTC
svn commit: r1897487 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java
Author: lehmi
Date: Wed Jan 26 07:28:27 2022
New Revision: 1897487
URL: http://svn.apache.org/viewvc?rev=1897487&view=rev
Log:
PDFBOX-5339: check dictionary type to avoid an IllegalArgumentException
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java?rev=1897487&r1=1897486&r2=1897487&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java Wed Jan 26 07:28:27 2022
@@ -195,6 +195,10 @@ public class PDType0Font extends PDFont
{
throw new IOException("Missing descendant font dictionary");
}
+ if (!COSName.FONT.equals(((COSDictionary) descendantFontDictBase).getCOSName(COSName.TYPE)))
+ {
+ throw new IOException("Missing or wrong type in descendant font dictionary");
+ }
descendantFont = PDFontFactory.createDescendantFont((COSDictionary) descendantFontDictBase, this);
readEncoding();
fetchCMapUCS2();