pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1655538 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
Date Thu, 29 Jan 2015 07:26:33 GMT
Author: tilman
Date: Thu Jan 29 07:26:32 2015
New Revision: 1655538

URL: http://svn.apache.org/r1655538
Log:
PDFBOX-2636: allow empty array in constructor

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java?rev=1655538&r1=1655537&r2=1655538&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
Thu Jan 29 07:26:32 2015
@@ -45,7 +45,7 @@ public final class PDColor
      */
     public PDColor(COSArray array, PDColorSpace colorSpace)
     {
-        if (array.get(array.size() - 1) instanceof COSName)
+        if (array.size() > 0 && array.get(array.size() - 1) instanceof COSName)
         {
             // color components (optional)
             components = new float[array.size() - 1];



Mime
View raw message