pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1771338 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNameTreeNode.java
Date Fri, 25 Nov 2016 16:37:15 GMT
Author: tilman
Date: Fri Nov 25 16:37:15 2016
New Revision: 1771338

URL: http://svn.apache.org/viewvc?rev=1771338&view=rev
Log:
PDFBOX-3594: ignore incorrect limits

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNameTreeNode.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNameTreeNode.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNameTreeNode.java?rev=1771338&r1=1771337&r2=1771338&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNameTreeNode.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNameTreeNode.java
Fri Nov 25 16:37:15 2016
@@ -225,8 +225,11 @@ public abstract class PDNameTreeNode<T e
                 for( int i=0; i<kids.size() && retval == null; i++ )
                 {
                     PDNameTreeNode<T> childNode = kids.get( i );
-                    if( childNode.getLowerLimit().compareTo( name ) <= 0 &&
-                        childNode.getUpperLimit().compareTo( name ) >= 0 )
+                    String upperLimit = childNode.getUpperLimit();
+                    String lowerLimit = childNode.getLowerLimit();
+                    if (upperLimit == null || lowerLimit == null || 
+                        upperLimit.compareTo(lowerLimit) < 0 ||
+                        (lowerLimit.compareTo(name) <= 0 && upperLimit.compareTo(name)
>= 0))
                     {
                         retval = childNode.getValue( name );
                     }



Mime
View raw message