summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-01-14 12:10:20 -0800
committerWei Li <weili@chromium.org>2016-01-14 12:10:20 -0800
commit5d5d9fe7bd1c9566b9d6570015b7c60894d9fc0c (patch)
treeff558a8ca8b51e7c1d7300602aae7d7195c8fb7e /fpdfsdk
parent0b56371b1e9683676cf191f2d9d41d40d47c3726 (diff)
downloadpdfium-5d5d9fe7bd1c9566b9d6570015b7c60894d9fc0c.tar.xz
Correct the way to count pages and to avoid infinite loop
BUG=pdfium:360 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1585823003 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/src/fpdfview_embeddertest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/fpdfsdk/src/fpdfview_embeddertest.cpp b/fpdfsdk/src/fpdfview_embeddertest.cpp
index 3147c01660..670c640668 100644
--- a/fpdfsdk/src/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/src/fpdfview_embeddertest.cpp
@@ -227,4 +227,9 @@ TEST_F(FPDFViewEmbeddertest, Hang_343) {
// dictionary will not cause an infinite loop in CPDF_SyntaxParser::GetObject().
TEST_F(FPDFViewEmbeddertest, Hang_344) {
EXPECT_FALSE(OpenDocument("bug_344.pdf"));
+}
+
+// The test should pass even when the file has circular references to pages.
+TEST_F(FPDFViewEmbeddertest, Hang_360) {
+ EXPECT_FALSE(OpenDocument("bug_360.pdf"));
} \ No newline at end of file