diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-02-07 20:18:15 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-07 20:18:15 +0000 |
commit | 2496f8e3f3cb1cbfffd664c9b5d7983dc192887b (patch) | |
tree | 8d9bae9a959837dc09bdb54d19a301263fbc4bca /xfa/fde | |
parent | 6c67da092ce8bb384f60e2eae32e18b7283ae76e (diff) | |
download | pdfium-2496f8e3f3cb1cbfffd664c9b5d7983dc192887b.tar.xz |
Restore assert when GetCharacterInfo is called on an empty edit.
CFWL_Edit::UpdateCursorRect now checks if the edit is empty before
getting the caret position.
Bug: chromium:592750
Change-Id: I792e90537741a78141fa084a646380bfe7ce4637
Reviewed-on: https://pdfium-review.googlesource.com/25910
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fde')
-rw-r--r-- | xfa/fde/cfde_texteditengine.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xfa/fde/cfde_texteditengine.cpp b/xfa/fde/cfde_texteditengine.cpp index 75fd103b3c..d085a8d147 100644 --- a/xfa/fde/cfde_texteditengine.cpp +++ b/xfa/fde/cfde_texteditengine.cpp @@ -1071,8 +1071,10 @@ std::pair<int32_t, CFX_RectF> CFDE_TextEditEngine::GetCharacterInfo( if (it->nStart <= start_idx && start_idx < it->nStart + it->nCount) break; } - if (it == text_piece_info_.end()) + if (it == text_piece_info_.end()) { + NOTREACHED(); return {0, CFX_RectF()}; + } return {it->nBidiLevel, GetCharRects(*it)[start_idx - it->nStart]}; } |