From 937840e1722d1f2b77d80575d6e710d760662c9c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 20 Oct 2015 13:30:34 -0400 Subject: Revert "Add type cast definitions for CPDF_Dictionary." This reverts commit 4816432671eef6467354aa252f22bb80acc315b7. Reason, broke the javascript_test Rendering PDF file /mnt/data/b/build/slave/linux/build/pdfium/out/Debug/gen/pdfium/testing/javascript/document_methods.pdf. Non-linearized path... FAILURE: document_methods.in; Command '['/mnt/data/b/build/slave/linux/build/pdfium/out/Debug/pdfium_test', '/mnt/data/b/build/slave/linux/build/pdfium/out/Debug/gen/pdfium/testing/javascript/document_methods.pdf']' returned non-zero exit status -11 BUG=pdfium:201 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1412413002 . --- fpdfsdk/src/fpdf_flatten.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/src/fpdf_flatten.cpp') diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp index fee93f2663..b2303f36aa 100644 --- a/fpdfsdk/src/fpdf_flatten.cpp +++ b/fpdfsdk/src/fpdf_flatten.cpp @@ -94,10 +94,11 @@ int ParserAnnots(CPDF_Document* pSourceDoc, FX_DWORD dwSize = pAnnots->GetCount(); for (int i = 0; i < (int)dwSize; i++) { - CPDF_Dictionary* pAnnotDic = ToDictionary(pAnnots->GetElementValue(i)); - if (!pAnnotDic) + CPDF_Object* pObj = pAnnots->GetElementValue(i); + if (!pObj || pObj->GetType() != PDFOBJ_DICTIONARY) continue; + CPDF_Dictionary* pAnnotDic = (CPDF_Dictionary*)pObj; CFX_ByteString sSubtype = pAnnotDic->GetString("Subtype"); if (sSubtype == "Popup") continue; -- cgit v1.2.3