pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1852576 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java
Date Thu, 31 Jan 2019 07:51:22 GMT
Author: tilman
Date: Thu Jan 31 07:51:22 2019
New Revision: 1852576

URL: http://svn.apache.org/viewvc?rev=1852576&view=rev
Log:
PDFBOX-4451: avoid ArrayIndexOutOfBoundsException

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java?rev=1852576&r1=1852575&r2=1852576&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java Thu
Jan 31 07:51:22 2019
@@ -18,6 +18,7 @@ package org.apache.pdfbox.pdmodel.common
 
 import java.awt.geom.GeneralPath;
 import java.awt.geom.Point2D;
+import java.util.Arrays;
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSFloat;
@@ -128,7 +129,7 @@ public class PDRectangle implements COSO
      */
     public PDRectangle( COSArray array )
     {
-        float[] values = array.toFloatArray();
+        float[] values = Arrays.copyOf(array.toFloatArray(), 4);
         rectArray = new COSArray();
         // we have to start with the lower left corner
         rectArray.add( new COSFloat( Math.min(values[0],values[2] )) );



Mime
View raw message