Make CPDF_ContentMarkItem stop caching the properties dict.
It could be aliased with some other dictionary in the file. We
note that the dictionary one level up will always be an indirect
object in the sharing case, and indirect objects are persisted
by the IndirectObjectHolder, so hold a pointer to that and retrieve
the specific property_name field on the fly.
Bug: chromium:900552
Change-Id: I2e300020d6a7191648dd139a485b6d284e259976
Reviewed-on: https://pdfium-review.googlesource.com/c/44970
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/testing/resources/bug_900552.in b/testing/resources/bug_900552.in
new file mode 100644
index 0000000..08763f8
--- /dev/null
+++ b/testing/resources/bug_900552.in
@@ -0,0 +1,76 @@
+{{header}}
+{{object 1 0}} <<
+ /Type /Catalog
+ /Pages 2 0 R
+ /OpenAction 8 0 R
+>>
+{{object 2 0}} <<
+ /Type /Pages
+ /Count 1
+ /Kids [3 0 R]
+>>
+endobj
+{{object 3 0}} <<
+ /Type /Page
+ /Parent 2 0 R
+ /MediaBox [0 0 600 700]
+ /Resources 5 0 R
+ /Contents 4 0 R
+ /Annots [6 0 R]
+>>
+endobj
+{{object 4 0}} <<
+ {{streamlen}}
+>>
+stream
+ (OC)
+ /V
+ BDC
+ BT
+ /F1 20 Tf
+ 100 100 Td
+ (Test) Tj
+ ET
+endstream
+endobj
+{{object 5 0}} <<
+ /Properties 6 0 R
+ /Font <<F1 7 0 R>>
+>>
+endobj
+{{object 6 0}} <<
+ /FT /Tx
+ /Type /Annot
+ /Subtype /Widget
+ /T (txt1)
+ /F 4
+ /Rect [200 200 400 400]
+ /V <</A (b)>>
+>>
+endobj
+{{object 7 0}} <<
+ /Type /Font
+ /Subtype /Type1
+ /BaseFont /Helvetica
+>>
+endobj
+{{object 8 0}} <<
+ /Type /Action
+ /S /JavaScript
+ /JS 9 0 R
+>>
+endobj
+{{object 9 0}} <<
+ {{streamlen}}
+>>
+stream
+function run() {
+ this.getField('txt1').value = 'a';
+}
+app.setTimeOut('run()', 1000)
+endstream
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF