Skip to content

Add openpdf-renderer #1357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2025
Merged

Add openpdf-renderer #1357

merged 1 commit into from
Jun 14, 2025

Conversation

andreasrosdal
Copy link
Contributor

Description of the new Feature/Bugfix

Add openpdf-renderer

Your real name

Andreas Røsdal

Copy link

@andreasrosdal andreasrosdal merged commit 05f303d into master Jun 14, 2025
7 of 9 checks passed
@andreasrosdal andreasrosdal deleted the openpdf-renderer branch June 14, 2025 20:37
}

if (rgb[i] < 0.003928) {
rgb[i] *= 12.92;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type double to narrower destination type
float
.

Copilot Autofix

AI 2 months ago

To fix the issue, we need to ensure that the multiplication operation in rgb[i] *= 12.92 is performed entirely in the float domain. This can be achieved by explicitly casting the constant 12.92 to float. This avoids the implicit cast from double to float and ensures that the operation is consistent with the type of rgb[i]. The change should be made on line 185 in the ciexyzToSRGB method.


Suggested changeset 1
openpdf-renderer/src/com/sun/pdfview/colorspace/CalRGBColor.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/openpdf-renderer/src/com/sun/pdfview/colorspace/CalRGBColor.java b/openpdf-renderer/src/com/sun/pdfview/colorspace/CalRGBColor.java
--- a/openpdf-renderer/src/com/sun/pdfview/colorspace/CalRGBColor.java
+++ b/openpdf-renderer/src/com/sun/pdfview/colorspace/CalRGBColor.java
@@ -184,3 +184,3 @@
               if (rgb[i] < 0.003928) {
-                  rgb[i] *= 12.92;
+                  rgb[i] *= 12.92f;
               } else {
EOF
@@ -184,3 +184,3 @@
if (rgb[i] < 0.003928) {
rgb[i] *= 12.92;
rgb[i] *= 12.92f;
} else {
Copilot is powered by AI and may make mistakes. Always verify output.

final Cipher cipher;
if (this.encryptionAlgorithm.isRC4()) {
cipher = Cipher.getInstance(CIPHER_RC4);

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm High

Cryptographic algorithm
RC4
is insecure. It has multiple vulnerabilities, including biases in its output and susceptibility to several attacks. Consider using AES instead.

Copilot Autofix

AI 2 months ago

To address the issue, we will replace the use of the RC4 algorithm with AES. Specifically:

  1. Update the CIPHER_RC4 constant to use a secure AES configuration (e.g., AES/CBC/PKCS5Padding).
  2. Modify the createAndInitialiseContentCipher method to handle AES decryption in place of RC4.
  3. Ensure that the decryption key and initialization vector are properly handled for AES.

This change will require updating the CIPHER_RC4 constant, replacing the RC4-specific logic in the createAndInitialiseContentCipher method, and ensuring that the decryption key and initialization vector are compatible with AES.


Suggested changeset 1
openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java b/openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java
--- a/openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java
+++ b/openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java
@@ -87,9 +87,10 @@
     /**
-     * The specification of the RC4 cipher for JCE interactions
-     */
-    private static final String CIPHER_RC4 = "RC4";
-    /**
-     * The key type for RC4 keys
-     */
-    private static final String KEY_RC4 = "RC4";
+     * The specification of the AES cipher for JCE interactions. As per the
+     * spec, cipher-block chaining (CBC) mode and PKCS5 padding are used
+     */
+    private static final String CIPHER_AES = "AES/CBC/PKCS5Padding";
+    /**
+     * The key type for AES keys
+     */
+    private static final String KEY_AES = "AES";
 
@@ -402,22 +403,20 @@
         final Cipher cipher;
-        if (this.encryptionAlgorithm.isRC4()) {
-            cipher = Cipher.getInstance(CIPHER_RC4);
-            cipher.init(Cipher.DECRYPT_MODE, createRC4Key(decryptionKeyBytes));
-        } else if (this.encryptionAlgorithm.isAES()) {
-            cipher = createAESCipher();
-            final byte[] initialisationVector = new byte[16];
-            if (encrypted.remaining() >= initialisationVector.length) {
-                encrypted.get(initialisationVector);
-            } else {
-                throw new PDFParseException(
-                        "AES encrypted stream too short - " +
-                                "no room for initialisation vector");
-            }
-
-            final SecretKeySpec aesKey =
-                    new SecretKeySpec(decryptionKeyBytes, KEY_AES);
-            final IvParameterSpec aesIv =
-                    new IvParameterSpec(initialisationVector);
-            cipher.init(Cipher.DECRYPT_MODE, aesKey, aesIv);
-        } else {
+        if (this.encryptionAlgorithm.isAES()) {
+            cipher = createAESCipher();
+            final byte[] initialisationVector = new byte[16];
+            if (encrypted.remaining() >= initialisationVector.length) {
+                encrypted.get(initialisationVector);
+            } else {
+                throw new PDFParseException(
+                        "AES encrypted stream too short - " +
+                                "no room for initialisation vector");
+            }
+
+            final SecretKeySpec aesKey =
+                    new SecretKeySpec(decryptionKeyBytes, KEY_AES);
+            final IvParameterSpec aesIv =
+                    new IvParameterSpec(initialisationVector);
+            cipher.init(Cipher.DECRYPT_MODE, aesKey, aesIv);
+        } else {
+            throw new PDFParseException("Unsupported encryption algorithm");
             throw new PDFParseException(
EOF
@@ -87,9 +87,10 @@
/**
* The specification of the RC4 cipher for JCE interactions
*/
private static final String CIPHER_RC4 = "RC4";
/**
* The key type for RC4 keys
*/
private static final String KEY_RC4 = "RC4";
* The specification of the AES cipher for JCE interactions. As per the
* spec, cipher-block chaining (CBC) mode and PKCS5 padding are used
*/
private static final String CIPHER_AES = "AES/CBC/PKCS5Padding";
/**
* The key type for AES keys
*/
private static final String KEY_AES = "AES";

@@ -402,22 +403,20 @@
final Cipher cipher;
if (this.encryptionAlgorithm.isRC4()) {
cipher = Cipher.getInstance(CIPHER_RC4);
cipher.init(Cipher.DECRYPT_MODE, createRC4Key(decryptionKeyBytes));
} else if (this.encryptionAlgorithm.isAES()) {
cipher = createAESCipher();
final byte[] initialisationVector = new byte[16];
if (encrypted.remaining() >= initialisationVector.length) {
encrypted.get(initialisationVector);
} else {
throw new PDFParseException(
"AES encrypted stream too short - " +
"no room for initialisation vector");
}

final SecretKeySpec aesKey =
new SecretKeySpec(decryptionKeyBytes, KEY_AES);
final IvParameterSpec aesIv =
new IvParameterSpec(initialisationVector);
cipher.init(Cipher.DECRYPT_MODE, aesKey, aesIv);
} else {
if (this.encryptionAlgorithm.isAES()) {
cipher = createAESCipher();
final byte[] initialisationVector = new byte[16];
if (encrypted.remaining() >= initialisationVector.length) {
encrypted.get(initialisationVector);
} else {
throw new PDFParseException(
"AES encrypted stream too short - " +
"no room for initialisation vector");
}

final SecretKeySpec aesKey =
new SecretKeySpec(decryptionKeyBytes, KEY_AES);
final IvParameterSpec aesIv =
new IvParameterSpec(initialisationVector);
cipher.init(Cipher.DECRYPT_MODE, aesKey, aesIv);
} else {
throw new PDFParseException("Unsupported encryption algorithm");
throw new PDFParseException(
Copilot is powered by AI and may make mistakes. Always verify output.
*/
private Cipher createRC4Cipher()
throws NoSuchAlgorithmException, NoSuchPaddingException {
return Cipher.getInstance(CIPHER_RC4);

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm High

Cryptographic algorithm
RC4
is insecure. It has multiple vulnerabilities, including biases in its output and susceptibility to several attacks. Consider using AES instead.

Copilot Autofix

AI 2 months ago

To fix the issue, we will replace the use of the RC4 algorithm with AES, which is a secure and modern cryptographic algorithm. Specifically:

  1. Replace the CIPHER_RC4 constant with a secure AES configuration, such as AES/CBC/PKCS5Padding.
  2. Update the createRC4Cipher method to create an AES cipher instead.
  3. Ensure that the key and initialization vector (IV) are properly handled for AES encryption/decryption.

The changes will involve modifying the CIPHER_RC4 constant, the createRC4Cipher method, and potentially other parts of the code that depend on RC4-specific behavior.


Suggested changeset 1
openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java b/openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java
--- a/openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java
+++ b/openpdf-renderer/src/com/sun/pdfview/decrypt/StandardDecrypter.java
@@ -89,7 +89,7 @@
      */
-    private static final String CIPHER_RC4 = "RC4";
-    /**
-     * The key type for RC4 keys
-     */
-    private static final String KEY_RC4 = "RC4";
+    private static final String CIPHER_AES = "AES/CBC/PKCS5Padding";
+    /**
+     * The key type for AES keys
+     */
+    private static final String KEY_AES = "AES";
 
@@ -1085,6 +1085,6 @@
      */
-    private Cipher createRC4Cipher()
-            throws NoSuchAlgorithmException, NoSuchPaddingException {
-        return Cipher.getInstance(CIPHER_RC4);
-    }
+    private Cipher createAESCipher()
+            throws NoSuchAlgorithmException, NoSuchPaddingException {
+        return Cipher.getInstance(CIPHER_AES);
+    }
 
EOF
@@ -89,7 +89,7 @@
*/
private static final String CIPHER_RC4 = "RC4";
/**
* The key type for RC4 keys
*/
private static final String KEY_RC4 = "RC4";
private static final String CIPHER_AES = "AES/CBC/PKCS5Padding";
/**
* The key type for AES keys
*/
private static final String KEY_AES = "AES";

@@ -1085,6 +1085,6 @@
*/
private Cipher createRC4Cipher()
throws NoSuchAlgorithmException, NoSuchPaddingException {
return Cipher.getInstance(CIPHER_RC4);
}
private Cipher createAESCipher()
throws NoSuchAlgorithmException, NoSuchPaddingException {
return Cipher.getInstance(CIPHER_AES);
}

Copilot is powered by AI and may make mistakes. Always verify output.
*/
private Cipher createAESCipher()
throws NoSuchAlgorithmException, NoSuchPaddingException {
return Cipher.getInstance(CIPHER_AES);

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm High

Cryptographic algorithm
AES/CBC/PKCS5Padding
is insecure. CBC mode with PKCS#5 or PKCS#7 padding is vulnerable to padding oracle attacks. Consider using GCM instead.
* @return the key
*/
private SecretKeySpec createRC4Key(byte[] keyBytes) {
return new SecretKeySpec(keyBytes, KEY_RC4);

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm High

Cryptographic algorithm
RC4
is insecure. It has multiple vulnerabilities, including biases in its output and susceptibility to several attacks. Consider using AES instead.
// the xIsSame bit controls the sign
val = -val;
}
yCoords[i] += val;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type int to narrower destination type
short
.

Copilot Autofix

AI 2 months ago

To fix the issue, we need to avoid the implicit narrowing conversion in the compound assignment yCoords[i] += val. This can be achieved by explicitly casting the result of the addition to short after ensuring that the value is within the valid range of a short. Alternatively, we can use a temporary variable of type int to hold the intermediate result and then safely cast it to short. This ensures that the code is explicit about the narrowing conversion and avoids unintended data loss or overflow.

The best approach is to replace the compound assignment with an explicit addition and cast the result to short. This makes the code more readable and avoids the implicit narrowing conversion.


Suggested changeset 1
openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
--- a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
+++ b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
@@ -129,3 +129,3 @@
                 }
-                yCoords[i] += val;
+                yCoords[i] = (short) (yCoords[i] + val);
             } else if (!yIsSame(i)) {
EOF
@@ -129,3 +129,3 @@
}
yCoords[i] += val;
yCoords[i] = (short) (yCoords[i] + val);
} else if (!yIsSame(i)) {
Copilot is powered by AI and may make mistakes. Always verify output.
short length = super.getLength();

// add the length of the end points
length += getNumContours() * 2;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type int to narrower destination type
short
.

Copilot Autofix

AI 2 months ago

To fix the issue, we need to ensure that the type of the left-hand side of the compound assignment (length) is at least as wide as the type of the right-hand side expression (getNumContours() * 2). The best way to address this is to change the type of length from short to int. This ensures that no implicit narrowing conversion occurs, and the calculation can safely handle larger values without overflow.

The changes involve:

  1. Updating the declaration of length on line 202 from short to int.
  2. Ensuring that the return type of the getLength() method remains short by explicitly casting the final result of length to short before returning it.

Suggested changeset 1
openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
--- a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
+++ b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
@@ -199,36 +199,36 @@
     @Override
-	public short getLength() {
-        // start with the length of the superclass
-        short length = super.getLength();
-        
-        // add the length of the end points
-        length += getNumContours() * 2;
-        
-        // add the length of the instructions
-        length += 2 + getNumInstructions();
-        
-        // add the length of the flags, avoiding repeats
-        for (int i = 0; i < getNumPoints(); i++) {
-            // check for repeats
-            while (i > 0 && (getFlag(i) == getFlag(i - 1)));
-            length++;
-        }
-        
-        // add the length of the xCoordinates
-        for (int i = 0; i < getNumPoints(); i++) {
-            if (xIsByte(i)) {
-                length++;
-            } else if (!xIsSame(i)) {
-                length += 2;
-            }
-            
-            if (yIsByte(i)) {
-                length++;
-            } else if (!yIsSame(i)) {
-                length += 2;
-            }
-        }
-         
-        return length;
-    }
+	public short getLength() {
+        // start with the length of the superclass
+        int length = super.getLength();
+        
+        // add the length of the end points
+        length += getNumContours() * 2;
+        
+        // add the length of the instructions
+        length += 2 + getNumInstructions();
+        
+        // add the length of the flags, avoiding repeats
+        for (int i = 0; i < getNumPoints(); i++) {
+            // check for repeats
+            while (i > 0 && (getFlag(i) == getFlag(i - 1)));
+            length++;
+        }
+        
+        // add the length of the xCoordinates
+        for (int i = 0; i < getNumPoints(); i++) {
+            if (xIsByte(i)) {
+                length++;
+            } else if (!xIsSame(i)) {
+                length += 2;
+            }
+            
+            if (yIsByte(i)) {
+                length++;
+            } else if (!yIsSame(i)) {
+                length += 2;
+            }
+        }
+         
+        return (short) length;
+    }
     
EOF
Copilot is powered by AI and may make mistakes. Always verify output.
length += getNumContours() * 2;

// add the length of the instructions
length += 2 + getNumInstructions();

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type int to narrower destination type
short
.

Copilot Autofix

AI 2 months ago

To fix the issue, we need to ensure that the type of the left-hand side of the compound assignment (length) is at least as wide as the type of the right-hand side (2 + getNumInstructions()). The best way to achieve this is to change the type of length from short to int. This ensures that no implicit narrowing conversion occurs during the compound assignment, and it avoids potential overflow or information loss.

Steps to implement the fix:

  1. Change the type of the length variable from short to int in the getLength() method.
  2. Ensure that the return type of the getLength() method remains short by explicitly casting the final result to short before returning it. This preserves the existing functionality while preventing implicit narrowing conversions during intermediate calculations.

Suggested changeset 1
openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
--- a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
+++ b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
@@ -199,36 +199,36 @@
     @Override
-	public short getLength() {
-        // start with the length of the superclass
-        short length = super.getLength();
-        
-        // add the length of the end points
-        length += getNumContours() * 2;
-        
-        // add the length of the instructions
-        length += 2 + getNumInstructions();
-        
-        // add the length of the flags, avoiding repeats
-        for (int i = 0; i < getNumPoints(); i++) {
-            // check for repeats
-            while (i > 0 && (getFlag(i) == getFlag(i - 1)));
-            length++;
-        }
-        
-        // add the length of the xCoordinates
-        for (int i = 0; i < getNumPoints(); i++) {
-            if (xIsByte(i)) {
-                length++;
-            } else if (!xIsSame(i)) {
-                length += 2;
-            }
-            
-            if (yIsByte(i)) {
-                length++;
-            } else if (!yIsSame(i)) {
-                length += 2;
-            }
-        }
-         
-        return length;
-    }
+	public short getLength() {
+        // start with the length of the superclass
+        int length = super.getLength();
+        
+        // add the length of the end points
+        length += getNumContours() * 2;
+        
+        // add the length of the instructions
+        length += 2 + getNumInstructions();
+        
+        // add the length of the flags, avoiding repeats
+        for (int i = 0; i < getNumPoints(); i++) {
+            // check for repeats
+            while (i > 0 && (getFlag(i) == getFlag(i - 1)));
+            length++;
+        }
+        
+        // add the length of the xCoordinates
+        for (int i = 0; i < getNumPoints(); i++) {
+            if (xIsByte(i)) {
+                length++;
+            } else if (!xIsSame(i)) {
+                length += 2;
+            }
+            
+            if (yIsByte(i)) {
+                length++;
+            } else if (!yIsSame(i)) {
+                length += 2;
+            }
+        }
+         
+        return (short) length;
+    }
     
EOF
Copilot is powered by AI and may make mistakes. Always verify output.
if (xIsByte(i)) {
length++;
} else if (!xIsSame(i)) {
length += 2;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type int to narrower destination type
short
.

Copilot Autofix

AI 2 months ago

To fix the issue, the type of the length variable should be changed from short to int. This ensures that all additions to length are performed without implicit narrowing conversions, and the risk of overflow is mitigated. The change involves updating the declaration of length on line 202 and ensuring that the return type of the getLength() method remains compatible with its usage elsewhere in the codebase.


Suggested changeset 1
openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
--- a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
+++ b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
@@ -199,36 +199,36 @@
     @Override
-	public short getLength() {
-        // start with the length of the superclass
-        short length = super.getLength();
-        
-        // add the length of the end points
-        length += getNumContours() * 2;
-        
-        // add the length of the instructions
-        length += 2 + getNumInstructions();
-        
-        // add the length of the flags, avoiding repeats
-        for (int i = 0; i < getNumPoints(); i++) {
-            // check for repeats
-            while (i > 0 && (getFlag(i) == getFlag(i - 1)));
-            length++;
-        }
-        
-        // add the length of the xCoordinates
-        for (int i = 0; i < getNumPoints(); i++) {
-            if (xIsByte(i)) {
-                length++;
-            } else if (!xIsSame(i)) {
-                length += 2;
-            }
-            
-            if (yIsByte(i)) {
-                length++;
-            } else if (!yIsSame(i)) {
-                length += 2;
-            }
-        }
-         
-        return length;
-    }
+	public int getLength() {
+	    // start with the length of the superclass
+	    int length = super.getLength();
+        
+	    // add the length of the end points
+	    length += getNumContours() * 2;
+        
+	    // add the length of the instructions
+	    length += 2 + getNumInstructions();
+        
+	    // add the length of the flags, avoiding repeats
+	    for (int i = 0; i < getNumPoints(); i++) {
+	        // check for repeats
+	        while (i > 0 && (getFlag(i) == getFlag(i - 1)));
+	        length++;
+	    }
+        
+	    // add the length of the xCoordinates
+	    for (int i = 0; i < getNumPoints(); i++) {
+	        if (xIsByte(i)) {
+	            length++;
+	        } else if (!xIsSame(i)) {
+	            length += 2;
+	        }
+            
+	        if (yIsByte(i)) {
+	            length++;
+	        } else if (!yIsSame(i)) {
+	            length += 2;
+	        }
+	    }
+         
+	    return length;
+	}
     
EOF
Copilot is powered by AI and may make mistakes. Always verify output.
if (yIsByte(i)) {
length++;
} else if (!yIsSame(i)) {
length += 2;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type int to narrower destination type
short
.

Copilot Autofix

AI 2 months ago

To fix the issue, we need to ensure that the type of the left-hand side of the compound assignment (length) is at least as wide as the type of the right-hand side (int). The best way to achieve this is to change the type of length from short to int. This avoids the implicit narrowing conversion and ensures that the variable can safely hold larger values if needed. The change should be made at the declaration of length on line 202.


Suggested changeset 1
openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
--- a/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
+++ b/openpdf-renderer/src/com/sun/pdfview/font/ttf/GlyfSimple.java
@@ -201,3 +201,3 @@
         // start with the length of the superclass
-        short length = super.getLength();
+        int length = super.getLength();
         
EOF
@@ -201,3 +201,3 @@
// start with the length of the superclass
short length = super.getLength();
int length = super.getLength();

Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant