summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdf_flatten.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fpdf_flatten.cpp')
-rw-r--r--fpdfsdk/src/fpdf_flatten.cpp5
1 files changed, 3 insertions, 2 deletions
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;