Prevent StackOverflow in ParseTrailer and fix #1122

This commit is contained in:
BobLd
2025-08-08 19:48:49 +01:00
parent 0f641774e6
commit 1031dcc221
3 changed files with 29 additions and 5 deletions

View File

@@ -7,6 +7,15 @@
public class GithubIssuesTests
{
[Fact]
public void Issue1122()
{
var path = IntegrationHelpers.GetSpecificTestDocumentPath("StackOverflow_Issue_1122.pdf");
var ex = Assert.Throws<PdfDocumentFormatException>(() => PdfDocument.Open(path, new ParsingOptions() { UseLenientParsing = true }));
Assert.StartsWith("Reached maximum search depth while getting indirect reference.", ex.Message);
}
[Fact]
public void Issue1096()
{