pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1780982 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
Date Mon, 30 Jan 2017 20:29:22 GMT
Author: tilman
Date: Mon Jan 30 20:29:22 2017
New Revision: 1780982

URL: http://svn.apache.org/viewvc?rev=1780982&view=rev
Log:
PDFBOX-3661: improve exception message

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?rev=1780982&r1=1780981&r2=1780982&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java Mon
Jan 30 20:29:22 2017
@@ -701,9 +701,11 @@ public class COSWriter implements ICOSVi
         byteRangeArray.set(2, COSInteger.get(afterOffset));
         byteRangeArray.set(3, COSInteger.get(afterLength));
 
-        if (byteRangeLength - byteRange.length() < 0)
+        if (byteRange.length() > byteRangeLength)
         {
-            throw new IOException("Can't write new ByteRange, not enough space");
+            throw new IOException("Can't write new byteRange '" + byteRange + 
+                    "' not enough space: byteRange.length(): " + byteRange.length() + 
+                    ", byteRangeLength: " + byteRangeLength);
         }
 
         // copy the new incremental data into a buffer (e.g. signature dict, trailer)



Mime
View raw message