Add a pixel test for page index clobbering

If given an object number that is not for a /Page,
CPDF_Document::GetPageIndex() can cache the incorrect object number for
a page index, leading to problems such as drawing blank pages.

The pixel test uses a /GoTo action to a /Pages node to trigger this
problem, drawing a blank page instead of the expected gray rectangle.

Bug: pdfium:1491
Change-Id: I9dc5a8fe401f81262097dd6bf0b51229a386d1ac
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/67652
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: K Moon <kmoon@chromium.org>
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index ae9cec0..5aab61e 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -337,6 +337,9 @@
 # TODO(pdfium:1457): Remove after associated bug is fixed
 bug_1457.in * * *
 
+# TODO(pdfium:1491): Remove after associated bug is fixed
+bug_1491.in * * *
+
 # TODO(chromium:451366): Remove after associated bug is fixed
 bug_451366.in * * *
 
diff --git a/testing/resources/pixel/bug_1491.in b/testing/resources/pixel/bug_1491.in
new file mode 100644
index 0000000..b973b2b
--- /dev/null
+++ b/testing/resources/pixel/bug_1491.in
@@ -0,0 +1,44 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+  /OpenAction 6 0 R
+>>
+endobj
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Pages
+  /Parent 2 0 R
+  /Count 1
+  /Kids [ 4 0 R ]
+>>
+{{object 4 0}} <<
+  /Type /Page
+  /Parent 3 0 R
+  /Contents 5 0 R
+>>
+endobj
+{{object 5 0}} <<
+  {{streamlen}}
+>>
+stream
+0.5 0.5 0.5 rg
+50 50 100 100 re B
+endstream
+endobj
+{{object 6 0}} <<
+  /Type /Action
+  /S /GoTo
+  /D [ 3 0 R /Fit ]
+>>
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/bug_1491_expected.pdf.0.png b/testing/resources/pixel/bug_1491_expected.pdf.0.png
new file mode 100644
index 0000000..21e9375
--- /dev/null
+++ b/testing/resources/pixel/bug_1491_expected.pdf.0.png
Binary files differ