Index: fpdfsdk/src/fpdf_flatten.cpp |
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp |
index 76ffec3e26edfbbabb94a8a5c300cad4df18aa35..2a0c2d947c9c087dec0a53a51460512f731e97b1 100644 |
--- a/fpdfsdk/src/fpdf_flatten.cpp |
+++ b/fpdfsdk/src/fpdf_flatten.cpp |
@@ -440,10 +440,9 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { |
if (!sAnnotState.IsEmpty()) { |
pAPStream = pAPDic->GetStream(sAnnotState); |
} else { |
- FX_POSITION pos = pAPDic->GetStartPos(); |
- if (pos) { |
- CFX_ByteString sKey; |
- CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey); |
+ auto it = pAPDic->begin(); |
+ if (it != pAPDic->end()) { |
+ CPDF_Object* pFirstObj = it->second; |
if (pFirstObj) { |
if (pFirstObj->IsReference()) |
pFirstObj = pFirstObj->GetDirect(); |