pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1836753 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
Date Thu, 26 Jul 2018 19:10:02 GMT
Author: tilman
Date: Thu Jul 26 19:10:02 2018
New Revision: 1836753

URL: http://svn.apache.org/viewvc?rev=1836753&view=rev
Log:
PDFBOX-4279: avoid NPE with empty annotation color that have no colorspace

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java?rev=1836753&r1=1836752&r2=1836753&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
Thu Jul 26 19:10:02 2018
@@ -113,9 +113,11 @@ public final class PDColor
      */
     public float[] getComponents()
     {
-        if (colorSpace instanceof PDPattern)
+        if (colorSpace instanceof PDPattern || colorSpace == null)
         {
             // colorspace of the pattern color isn't known, so just clone
+            // null colorspace can happen with empty annotation color
+            // see PDFBOX-3351-538928-p4.pdf
             return components.clone();
         }
         // PDFBOX-4279: copyOf instead of clone in case array is too small



Mime
View raw message