pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1791209 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/color/SetColor.java
Date Thu, 13 Apr 2017 04:13:16 GMT
Author: tilman
Date: Thu Apr 13 04:13:16 2017
New Revision: 1791209

URL: http://svn.apache.org/viewvc?rev=1791209&view=rev
Log:
PDFBOX-3755: skip operators with non number parameters

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/color/SetColor.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/color/SetColor.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/color/SetColor.java?rev=1791209&r1=1791208&r2=1791209&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/color/SetColor.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/color/SetColor.java
Thu Apr 13 04:13:16 2017
@@ -26,6 +26,7 @@ import org.apache.pdfbox.contentstream.o
 
 import java.io.IOException;
 import java.util.List;
+import org.apache.pdfbox.cos.COSNumber;
 import org.apache.pdfbox.pdmodel.graphics.color.PDPattern;
 
 /**
@@ -39,10 +40,16 @@ public abstract class SetColor extends O
     public void process(Operator operator, List<COSBase> arguments) throws IOException
     {
         PDColorSpace colorSpace = getColorSpace();
-        if (!(colorSpace instanceof PDPattern) &&
-            arguments.size() < colorSpace.getNumberOfComponents())
+        if (!(colorSpace instanceof PDPattern))
         {
-            throw new MissingOperandException(operator, arguments);
+            if (arguments.size() < colorSpace.getNumberOfComponents())
+            {
+                throw new MissingOperandException(operator, arguments);
+            }
+            if (!checkArrayTypesClass(arguments, COSNumber.class))
+            {
+                return;
+            }
         }
         COSArray array = new COSArray();
         array.addAll(arguments);



Mime
View raw message