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 2015/03/27 21:07:19 UTC

svn commit: r1669670 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java

Author: tilman
Date: Fri Mar 27 20:07:18 2015
New Revision: 1669670

URL: http://svn.apache.org/r1669670
Log:
PDFBOX-2734: use base variable; return array as COSObject; fix array overflow introduced in rev 1429524

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java?rev=1669670&r1=1669669&r2=1669670&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java Fri Mar 27 20:07:18 2015
@@ -62,8 +62,6 @@ public class PDDeviceN extends PDColorSp
      */
     public static final String NAME = "DeviceN";
 
-    private COSArray array;
-
     /**
      * Constructor.
      */
@@ -87,6 +85,12 @@ public class PDDeviceN extends PDColorSp
         array = csAttributes;
     }
 
+    @Override
+    public COSBase getCOSObject()
+    {
+        return array;
+    }
+    
     /**
      * This will return the name of the color space.  For a PDDeviceN object
      * this will always return "DeviceN"
@@ -262,7 +266,7 @@ public class PDDeviceN extends PDColorSp
         else
         {
             //make sure array is large enough
-            while( array.size() <= DEVICEN_ATTRIBUTES + 1 )
+            while (array.size() <= DEVICEN_ATTRIBUTES)
             {
                 array.add( COSNull.NULL );
             }