summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/fpdf_font/fpdf_font_cid.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index d5fe4dfd92..01a0f6cbdd 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -191,7 +191,9 @@ CIDSet CIDSetFromSizeT(size_t index) {
}
CFX_ByteStringC CMap_GetString(const CFX_ByteStringC& word) {
- return word.Mid(1, word.GetLength() - 2);
+ if (word.GetLength() <= 2)
+ return CFX_ByteStringC();
+ return CFX_ByteStringC(&word[1], word.GetLength() - 2);
}
int CompareDWORD(const void* data1, const void* data2) {