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, 2 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index b2303f36aa..fee93f2663 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -94,11 +94,10 @@ int ParserAnnots(CPDF_Document* pSourceDoc,
FX_DWORD dwSize = pAnnots->GetCount();
for (int i = 0; i < (int)dwSize; i++) {
- CPDF_Object* pObj = pAnnots->GetElementValue(i);
- if (!pObj || pObj->GetType() != PDFOBJ_DICTIONARY)
+ CPDF_Dictionary* pAnnotDic = ToDictionary(pAnnots->GetElementValue(i));
+ if (!pAnnotDic)
continue;
- CPDF_Dictionary* pAnnotDic = (CPDF_Dictionary*)pObj;
CFX_ByteString sSubtype = pAnnotDic->GetString("Subtype");
if (sSubtype == "Popup")
continue;