Skip to content

Commit

Permalink
Fix issue #354
Browse files Browse the repository at this point in the history
  • Loading branch information
OfficeDevUnofficial committed Apr 18, 2023
1 parent 20dabf9 commit 53b6876
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions PdfSharpCore/Pdf.Content/CLexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ public CSymbol ScanInlineImage()
if (ascii85)
{
// Look for '~>' because 'EI' may be part of the encoded image.
while (_currChar != '~' || _nextChar != '>')
// currChar != Chars.EOF: Addresses issue #354 - malformed PDF that ends without closing an inline image
while (_currChar != Chars.EOF && ( _currChar != '~' || _nextChar != '>'))
ScanNextChar();
}

// Look for 'EI'.
while (_currChar != 'E' || _nextChar != 'I')
// currChar != Chars.EOF: Addresses issue #354 - malformed PDF that ends without closing an inline image
while (_currChar != Chars.EOF && (_currChar != 'E' || _nextChar != 'I'))
ScanNextChar();

// We currently do nothing with inline images.
Expand Down

0 comments on commit 53b6876

Please sign in to comment.