handle newlines before inline images and support larger data streams in brute force search

This commit is contained in:
Eliot Jones
2019-12-18 12:02:07 +00:00
parent 1fb416eee3
commit dab64ec406
2 changed files with 6 additions and 1 deletions

View File

@@ -49,6 +49,10 @@
bool endobjFound = false;
do
{
if (loopProtection >= 700_000)
{
}
if (loopProtection > 1_000_000)
{
throw new PdfDocumentFormatException("Failed to brute-force search the file due to an infinite loop.");
@@ -92,6 +96,7 @@
{
bytes.MoveNext();
currentOffset++;
loopProtection = 0;
}
continue;