pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1868404 - in /pdfbox/branches/issue4569: ./ 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:30 GMT
Author: lehmi
Date: Sun Oct 13 13:07:29 2019
New Revision: 1868404

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

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

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

Modified: pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java?rev=1868404&r1=1868403&r2=1868404&view=diff
==============================================================================
--- pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
(original)
+++ pdfbox/branches/issue4569/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
Sun Oct 13 13:07:29 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/branches/issue4569/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java?rev=1868404&r1=1868403&r2=1868404&view=diff
==============================================================================
--- pdfbox/branches/issue4569/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
(original)
+++ pdfbox/branches/issue4569/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
Sun Oct 13 13:07:29 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