mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-19 02:37:56 +08:00
handle empty encrypted portion in adobe type 1 font
the encrypted portion of an adobe type 1 font can be empty in which case we default to a blank private dictionary and charstrings set.
This commit is contained in:
@@ -22,6 +22,15 @@
|
||||
}
|
||||
|
||||
var decrypted = Decrypt(bytes, EexecEncryptionKey, EexecRandomBytes);
|
||||
|
||||
if (decrypted.Count == 0)
|
||||
{
|
||||
var defaultPrivateDictionary = new Type1PrivateDictionary(new Type1PrivateDictionary.Builder());
|
||||
var defaultCharstrings = new Type1CharStrings(new Dictionary<string, Type1CharStrings.CommandSequence>(),
|
||||
new Dictionary<int, string>(),
|
||||
new Dictionary<int, Type1CharStrings.CommandSequence>());
|
||||
return (defaultPrivateDictionary, defaultCharstrings);
|
||||
}
|
||||
|
||||
var tokenizer = new Type1Tokenizer(new ByteArrayInputBytes(decrypted));
|
||||
|
||||
|
Reference in New Issue
Block a user