pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1857200 - /pdfbox/branches/issue45/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
Date Tue, 09 Apr 2019 13:40:49 GMT
Author: tilman
Date: Tue Apr  9 13:40:49 2019
New Revision: 1857200

URL: http://svn.apache.org/viewvc?rev=1857200&view=rev
Log:
PDFBOX-4489: check order of LangSysTag in the hope to detect corrupt table

Modified:
    pdfbox/branches/issue45/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java

Modified: pdfbox/branches/issue45/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java?rev=1857200&r1=1857199&r2=1857200&view=diff
==============================================================================
--- pdfbox/branches/issue45/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
(original)
+++ pdfbox/branches/issue45/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
Tue Apr  9 13:40:49 2019
@@ -122,13 +122,12 @@ public class GlyphSubstitutionTable exte
             {
                 // PDFBOX-4489: catch corrupt file
                 // https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#slTbl_sRec
-                LOG.error("LangSysRecords not alphabetically sorted by LangSys tag: " +
+                throw new IOException("LangSysRecords not alphabetically sorted by LangSys
tag: " +
                           langSysRecord.langSysTag + " <= " + prevLangSysTag);
-                scriptTable.langSysTables = new LinkedHashMap<String, LangSysTable>();
-                return scriptTable;
             }
             langSysOffsets[i] = data.readUnsignedShort();
             langSysRecords[i] = langSysRecord;
+            prevLangSysTag = langSysRecord.langSysTag;
         }
         if (defaultLangSys != 0)
         {



Mime
View raw message