mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 04:31:25 +08:00
fix #670 by ignoring duplicate endstream definitions
when parsing a stream object with multiple endstream tokens the last parsed token was selected instead of the actual stream token so instead we just skip all following tokens if the first is a stream and the following tokens are `endstream` operators only
This commit is contained in:
parent
daaac9350d
commit
781991b6bf
@ -268,6 +268,12 @@
|
||||
{
|
||||
token = trimmedDuplicatedEndTokens[0];
|
||||
}
|
||||
else if (readTokens[0] is StreamToken str
|
||||
&& readTokens.Skip(1).All(x => x is OperatorToken op && op.Equals(OperatorToken.EndStream)))
|
||||
{
|
||||
// If a stream token is followed by "endstream" operator tokens just skip the following duplicated tokens.
|
||||
token = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
token = readTokens[readTokens.Count - 1];
|
||||
|
Loading…
Reference in New Issue
Block a user