pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1636430 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java
Date Mon, 03 Nov 2014 20:22:15 GMT
Author: tilman
Date: Mon Nov  3 20:22:15 2014
New Revision: 1636430

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

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

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java?rev=1636430&r1=1636429&r2=1636430&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java
Mon Nov  3 20:22:15 2014
@@ -129,10 +129,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."));
             }
 
         }



Mime
View raw message