pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1689738 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
Date Tue, 07 Jul 2015 20:49:13 GMT
Author: tilman
Date: Tue Jul  7 20:49:13 2015
New Revision: 1689738

URL: http://svn.apache.org/r1689738
Log:
PDFBOX-2854: throw IllegalStateException if subset is empty

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java?rev=1689738&r1=1689737&r2=1689738&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java Tue Jul  7
20:49:13 2015
@@ -913,9 +913,15 @@ public final class TTFSubsetter
      *
      * @param os the stream used for writing
      * @throws IOException if something went wrong.
+     * @throws IllegalStateException if the subset is empty.
      */
     public void writeToStream(OutputStream os) throws IOException
     {
+        if (glyphIds.isEmpty() || uniToGID.isEmpty())
+        {
+            throw new IllegalStateException("subset is empty");
+        }
+        
         addCompoundReferences();
 
         DataOutputStream out = new DataOutputStream(os);



Mime
View raw message