pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1868403 - in /pdfbox/trunk: ./ fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
Date Sun, 13 Oct 2019 13:07:10 GMT
Author: lehmi
Date: Sun Oct 13 13:07:09 2019
New Revision: 1868403

URL: http://svn.apache.org/viewvc?rev=1868403&view=rev
Log:
PDFBOX-4661: fixed comparison

Modified:
    pdfbox/trunk/   (props changed)
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
    pdfbox/trunk/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java

Propchange: pdfbox/trunk/
------------------------------------------------------------------------------
  Merged /pdfbox/branches/2.0:r1868402

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java?rev=1868403&r1=1868402&r2=1868403&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java Sun Oct 13
13:07:09 2019
@@ -382,8 +382,8 @@ public class CMapParser
                 if (tokenBytes.length > 0)
                 {
                     // PDFBOX-4661: avoid overflow of the last byte, all following values
are undefined
-                    int values = Math.min(end - start + 1,
-                            255 - (tokenBytes[tokenBytes.length - 1] & 0xFF));
+                    int values = Math.min(end - start,
+                            255 - (tokenBytes[tokenBytes.length - 1] & 0xFF)) + 1;
                     addMappingFrombfrange(result, startCode, values, tokenBytes);
                 }
             }

Modified: pdfbox/trunk/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java?rev=1868403&r1=1868402&r2=1868403&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java (original)
+++ pdfbox/trunk/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java Sun Oct
13 13:07:09 2019
@@ -151,8 +151,8 @@ public class TestCMapParser extends Test
         assertEquals("bytes 02 32 from bfrange <0232> <0432> <0041>", "A",
cMap.toUnicode(0x232));
 
         // check border values
-        assertNotNull(cMap.toUnicode(0x2EF));
-        assertNull(cMap.toUnicode(0x2F0));
+        assertNotNull(cMap.toUnicode(0x2F0));
+        assertNull(cMap.toUnicode(0x2F1));
 
     }
 



Mime
View raw message