pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1860824 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSInputStream.java
Date Sat, 08 Jun 2019 11:20:32 GMT
Author: tilman
Date: Sat Jun  8 11:20:32 2019
New Revision: 1860824

URL: http://svn.apache.org/viewvc?rev=1860824&view=rev
Log:
PDFBOX-4071: avoid duplicates

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSInputStream.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSInputStream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSInputStream.java?rev=1860824&r1=1860823&r2=1860824&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSInputStream.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSInputStream.java Sat Jun  8
11:20:32 2019
@@ -23,7 +23,9 @@ import java.io.FilterInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.pdfbox.filter.DecodeOptions;
 import org.apache.pdfbox.filter.DecodeResult;
@@ -67,6 +69,11 @@ public final class COSInputStream extend
         }
         else
         {
+            Set<Filter> filterSet = new HashSet<>(filters);
+            if (filterSet.size() != filters.size())
+            {
+                throw new IOException("Duplicate");
+            }
             // apply filters
             for (int i = 0; i < filters.size(); i++)
             {



Mime
View raw message