Index: fpdfsdk/src/fpdf_flatten.cpp |
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp |
index b2303f36aa0758f87b9a0e7177a1a5495fbf1800..fee93f2663023cc9735b65a90bf5e11c34378ff3 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; |