Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/PdfSharp/Pdf.IO/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ public PdfObject ReadObject(PdfObject pdfObject, PdfObjectID objectID, bool incl
ParserDiagnostics.HandleUnexpectedToken(_lexer.Token);
break;
}
int revert_pos = _lexer.Position;
symbol = ScanNextToken();
if (symbol == Symbol.BeginStream)
{
Expand Down Expand Up @@ -299,11 +300,12 @@ public PdfObject ReadObject(PdfObject pdfObject, PdfObjectID objectID, bool incl
PdfDictionary.PdfStream stream = new PdfDictionary.PdfStream(bytes, dict);
dict.Stream = stream;
ReadSymbol(Symbol.EndStream);
revert_pos = _lexer.Position;
symbol = ScanNextToken();
#endif
}
if (!fromObjecStream && symbol != Symbol.EndObj)
ParserDiagnostics.ThrowParserException(PSSR.UnexpectedToken(_lexer.Token));
if (!fromObjecStream && symbol != Symbol.EndObj)
_lexer.Position = revert_pos;
return pdfObject;
}

Expand Down