You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2014/11/03 21:22:29 UTC

svn commit: r1636431 - /pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java

Author: tilman
Date: Mon Nov  3 20:22:29 2014
New Revision: 1636431

URL: http://svn.apache.org/r1636431
Log:
PDFBOX-2478: avoid NPE for image masks without bpc

Modified:
    pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java

Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java?rev=1636431&r1=1636430&r2=1636431&view=diff
==============================================================================
--- pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java (original)
+++ pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java Mon Nov  3 20:22:29 2014
@@ -130,10 +130,10 @@ public class XObjImageValidator extends 
             }
 
             Integer bitsPerCompValue = COSUtils.getAsInteger(bitsPerComp, cosDocument);
-            if (bitsPerCompValue != 1)
+            if (bitsPerCompValue != null && bitsPerCompValue != 1)
             {
                 context.addValidationError(new ValidationError(ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY,
-                        "ImageMask entry is true, BitsPerComponent must be 1."));
+                        "ImageMask entry is true, BitsPerComponent must be absent or 1."));
             }
 
         }