You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ja...@apache.org on 2014/02/26 22:54:12 UTC

svn commit: r1572283 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/ccitt/TIFFFaxDecoder.java

Author: jahewson
Date: Wed Feb 26 21:54:12 2014
New Revision: 1572283

URL: http://svn.apache.org/r1572283
Log:
PDFBOX-1916: java.lang.ArrayIndexOutOfBoundsException in inlineimage

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/ccitt/TIFFFaxDecoder.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/ccitt/TIFFFaxDecoder.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/ccitt/TIFFFaxDecoder.java?rev=1572283&r1=1572282&r2=1572283&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/ccitt/TIFFFaxDecoder.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/ccitt/TIFFFaxDecoder.java Wed Feb 26 21:54:12 2014
@@ -1077,6 +1077,13 @@ public final class TIFFFaxDecoder {
                 }
             }
 
+            // workaround for PDFBOX-1916, it is not clear whether the
+            // code in the class is to blame or if the PDF is corrupt
+            if (cce.length == currIndex)
+            {
+                break;
+            }
+
             // Add the changing element beyond the current scanline for the
             // other color too
             cce[currIndex++] = bitOffset;