diff options
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/cpdf_formcontrol.cpp | 3 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_formfield.cpp | 3 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_interactiveform.cpp | 9 |
3 files changed, 10 insertions, 5 deletions
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp index edd5fe566c..7ff0914590 100644 --- a/core/fpdfdoc/cpdf_formcontrol.cpp +++ b/core/fpdfdoc/cpdf_formcontrol.cpp @@ -48,7 +48,8 @@ ByteString CPDF_FormControl::GetOnStateName() const { if (!pN) return csOn; - for (const auto& it : *pN) { + CPDF_DictionaryLocker locker(pN); + for (const auto& it : locker) { if (it.first != "Off") return it.first; } diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index 2b06161b06..89030b4132 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -796,7 +796,8 @@ bool CPDF_FormField::IsOptionSelected(int iOptIndex) const { if (!pArray) return false; - for (const auto& pObj : *pArray) { + CPDF_ArrayLocker locker(pArray); + for (const auto& pObj : locker) { if (pObj->GetInteger() == iOptIndex) return true; } diff --git a/core/fpdfdoc/cpdf_interactiveform.cpp b/core/fpdfdoc/cpdf_interactiveform.cpp index 403344c0ff..382d3dd314 100644 --- a/core/fpdfdoc/cpdf_interactiveform.cpp +++ b/core/fpdfdoc/cpdf_interactiveform.cpp @@ -154,7 +154,8 @@ CPDF_Font* GetNativeFont(CPDF_Dictionary* pFormDict, if (!pFonts) return nullptr; - for (const auto& it : *pFonts) { + CPDF_DictionaryLocker locker(pFonts); + for (const auto& it : locker) { const ByteString& csKey = it.first; if (!it.second) continue; @@ -194,7 +195,8 @@ bool FindFont(CPDF_Dictionary* pFormDict, if (!pFonts) return false; - for (const auto& it : *pFonts) { + CPDF_DictionaryLocker locker(pFonts); + for (const auto& it : locker) { const ByteString& csKey = it.first; if (!it.second) continue; @@ -230,7 +232,8 @@ bool FindFont(CPDF_Dictionary* pFormDict, if (csFontName.GetLength() > 0) csFontName.Remove(' '); - for (const auto& it : *pFonts) { + CPDF_DictionaryLocker locker(pFonts); + for (const auto& it : locker) { const ByteString& csKey = it.first; if (!it.second) continue; |