summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/font/cpdf_cmapparser.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfapi/font/cpdf_cmapparser.cpp b/core/fpdfapi/font/cpdf_cmapparser.cpp
index fbd6daf851..a88448c5bd 100644
--- a/core/fpdfapi/font/cpdf_cmapparser.cpp
+++ b/core/fpdfapi/font/cpdf_cmapparser.cpp
@@ -17,7 +17,6 @@
#include "core/fxcrt/fx_extension.h"
#include "core/fxge/fx_freetype.h"
#include "third_party/base/logging.h"
-#include "third_party/base/stl_util.h"
namespace {
@@ -110,14 +109,14 @@ void CPDF_CMapParser::ParseWord(const ByteStringView& word) {
m_Status = 0;
} else if (m_Status == 7) {
if (word == "endcodespacerange") {
- uint32_t nSegs = pdfium::CollectionSize<uint32_t>(m_CodeRanges);
- if (nSegs > 1) {
- m_pCMap->SetCodingScheme(CPDF_CMap::MixedFourBytes);
- m_pCMap->SetMixedFourByteLeadingRanges(m_CodeRanges);
- } else if (nSegs == 1) {
+ size_t nSegs = m_CodeRanges.size();
+ if (nSegs == 1) {
m_pCMap->SetCodingScheme((m_CodeRanges[0].m_CharSize == 2)
? CPDF_CMap::TwoBytes
: CPDF_CMap::OneByte);
+ } else if (nSegs > 1) {
+ m_pCMap->SetCodingScheme(CPDF_CMap::MixedFourBytes);
+ m_pCMap->SetMixedFourByteLeadingRanges(m_CodeRanges);
}
m_Status = 0;
} else {