diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-05-14 16:38:40 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-14 16:38:40 +0000 |
commit | ff3d00d703dd0273922fbae12d0ee50a14667657 (patch) | |
tree | d9e4ca582053f934012707422c68dd14b3a9ea14 | |
parent | d81544b3f5b3eeac34f0a3ecf749254e1f86a96f (diff) | |
download | pdfium-ff3d00d703dd0273922fbae12d0ee50a14667657.tar.xz |
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 <hnakashima@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
-rw-r--r-- | fpdfsdk/fpdf_doc_embeddertest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 |