summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_bidi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_bidi.cpp')
-rw-r--r--core/fxcrt/fx_bidi.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/fxcrt/fx_bidi.cpp b/core/fxcrt/fx_bidi.cpp
index 7261d80af3..669fc5bd88 100644
--- a/core/fxcrt/fx_bidi.cpp
+++ b/core/fxcrt/fx_bidi.cpp
@@ -531,8 +531,12 @@ class CFX_BidiLine {
}
void Position(std::vector<CFX_Char>* chars, size_t iCount) {
- for (size_t i = 0; i < iCount; ++i)
+ for (size_t i = 0; i < iCount; ++i) {
+ if ((*chars)[i].m_iBidiPos > iCount)
+ continue;
+
(*chars)[(*chars)[i].m_iBidiPos].m_iBidiOrder = i;
+ }
}
};