pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1862263 - /pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
Date Fri, 28 Jun 2019 04:25:58 GMT
Author: tilman
Date: Fri Jun 28 04:25:58 2019
New Revision: 1862263

URL: http://svn.apache.org/viewvc?rev=1862263&view=rev
Log:
PDFBOX-4071: Sonar fix: prevent "int" promotion by adding "& 0xff"

Modified:
    pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java

Modified: pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java?rev=1862263&r1=1862262&r2=1862263&view=diff
==============================================================================
--- pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
(original)
+++ pdfbox/branches/issue4569/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
Fri Jun 28 04:25:58 2019
@@ -677,7 +677,7 @@ final class FileSystemFontProvider exten
                         String registryName = reg.substring(0, reg.indexOf('\0'));
                         String ord = new String(bytes, 76, 64, Charsets.US_ASCII);
                         String orderName = ord.substring(0, ord.indexOf('\0'));
-                        int supplementVersion = bytes[140] << 8 & bytes[141];
+                        int supplementVersion = bytes[140] << 8 & (bytes[141] &
0xFF);
                         ros = new CIDSystemInfo(registryName, orderName, supplementVersion);
                     }
                     



Mime
View raw message