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:
Eliot Jones
2020-01-25 16:41:54 +00:00
parent 736f83e227
commit d9492ab2f8

View File

@@ -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));