pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1601451 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java
Date Mon, 09 Jun 2014 17:46:15 GMT
Author: lehmi
Date: Mon Jun  9 17:46:14 2014
New Revision: 1601451

URL: http://svn.apache.org/r1601451
Log:
PDFBOX-2074: ignore mapformed mappings based on a proposal of Juraj Lonc

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java?rev=1601451&r1=1601450&r2=1601451&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java Mon Jun  9 17:46:14
2014
@@ -17,7 +17,6 @@
 package org.apache.fontbox.cmap;
 
 import java.io.IOException;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedList;
@@ -25,14 +24,18 @@ import java.util.List;
 import java.util.Map;
 import java.util.Iterator;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
  * This class represents a CMap file.
  *
  * @author Ben Litchfield (ben@benlitchfield.com)
- * @version $Revision: 1.3 $
  */
 public class CMap
 {
+ 
+    private static final Log LOG = LogFactory.getLog(CMap.class);
     
     private int wmode = 0;
     private String cmapName = null;
@@ -234,7 +237,8 @@ public class CMap
         }
         else
         {
-            throw new IOException( "Mapping code should be 1 or two bytes and not " + src.length
);
+            // Just log the invalid entry instead of throwing an exception
+            LOG.error("Mapping code should be 1 or two bytes and not " + src.length);
         }
     }
 



Mime
View raw message