From ff3d00d703dd0273922fbae12d0ee50a14667657 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 14 May 2018 16:38:40 +0000 Subject: Add regression test for XFA crash under CPDF_LinkList::GetPageLinks(). Bug: 840922 Change-Id: I984db568153bd55eff6d217e6a5219fd8a32c947 Reviewed-on: https://pdfium-review.googlesource.com/32470 Reviewed-by: Henrique Nakashima Commit-Queue: Tom Sepez --- fpdfsdk/fpdf_doc_embeddertest.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fpdfsdk/fpdf_doc_embeddertest.cpp b/fpdfsdk/fpdf_doc_embeddertest.cpp index 43af5f26c7..c1f5e02ed6 100644 --- a/fpdfsdk/fpdf_doc_embeddertest.cpp +++ b/fpdfsdk/fpdf_doc_embeddertest.cpp @@ -441,3 +441,17 @@ TEST_F(FPDFDocEmbeddertest, GetPageLabels) { ASSERT_EQ(0u, FPDF_GetPageLabel(document(), 7, buf, sizeof(buf))); ASSERT_EQ(0u, FPDF_GetPageLabel(document(), 8, buf, sizeof(buf))); } + +#ifdef PDF_ENABLE_XFA +TEST_F(FPDFDocEmbeddertest, GetXFALinks) { + EXPECT_TRUE(OpenDocument("simple_xfa.pdf")); + + ScopedFPDFPage page(FPDF_LoadPage(document(), 0)); + ASSERT_TRUE(page); + + FPDFLink_GetLinkAtPoint(page.get(), 150, 360); + FPDFLink_GetLinkAtPoint(page.get(), 150, 420); + + // Test passes if it doesn't crash. See https://crbug.com/840922 +} +#endif // PDF_ENABLE_XFA -- cgit v1.2.3