mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 06:38:07 +08:00
Check ColorSpace token as dictionary and fix issue #1061
This commit is contained in:
parent
89abf6de54
commit
d1d79b0b4c
@ -119,6 +119,13 @@
|
||||
|
||||
namedColorSpaces[name] = new ResourceColorSpace(arrayNamedColorSpace, colorSpaceArray);
|
||||
}
|
||||
else if (parsingOptions.UseLenientParsing &&
|
||||
DirectObjectFinder.TryGet(nameColorSpacePair.Value, scanner, out DictionaryToken? dict) &&
|
||||
dict.TryGet(NameToken.ColorSpace, scanner, out NameToken? csName))
|
||||
{
|
||||
// See issue #1061
|
||||
namedColorSpaces[name] = new ResourceColorSpace(csName);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new PdfDocumentFormatException($"Invalid ColorSpace token encountered in page resource dictionary: {nameColorSpacePair.Value}.");
|
||||
|
Loading…
Reference in New Issue
Block a user