pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1868402 - in /pdfbox/branches/2.0/fontbox/src: main/java/org/apache/fontbox/cmap/CMapParser.java test/java/org/apache/fontbox/cmap/TestCMapParser.java
Date Sun, 13 Oct 2019 13:06:16 GMT
Author: lehmi
Date: Sun Oct 13 13:06:16 2019
New Revision: 1868402

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

Modified:
    pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
    pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java?rev=1868402&r1=1868401&r2=1868402&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java Sun
Oct 13 13:06:16 2019
@@ -388,8 +388,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/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java?rev=1868402&r1=1868401&r2=1868402&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
(original)
+++ pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
Sun Oct 13 13:06:16 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