mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
handle infinity symbol encountered in edge-case files
This commit is contained in:
parent
f2188729a3
commit
3cd81297c1
@ -94,7 +94,7 @@
|
||||
throw new InvalidOperationException($"Failed to read expected buffer length {gap} on page {pageNumber} " +
|
||||
$"when reading inline image at offset in content: {lastEndImageOffset.Value}.");
|
||||
}
|
||||
|
||||
|
||||
// Replace the last end image operator with one containing the full set of data.
|
||||
graphicsStateOperations.Remove(lastEndImage);
|
||||
graphicsStateOperations.Add(new EndInlineImage(lastEndImage.ImageData.Concat(missingData).ToArray()));
|
||||
@ -142,6 +142,13 @@
|
||||
graphicsStateOperations.Add(newEndInlineImage);
|
||||
lastEndImageOffset = scanner.CurrentPosition - 3;
|
||||
}
|
||||
else if (op.Data == "inf")
|
||||
{
|
||||
// Value representing infinity in broken file from #467.
|
||||
// Treat as zero.
|
||||
precedingTokens.Add(NumericToken.Zero);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.Warn($"Operator which was not understood encountered. Values was {op.Data}. Ignoring.");
|
||||
|
Loading…
Reference in New Issue
Block a user