summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfedittext.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-05-23 13:16:09 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-23 17:29:00 +0000
commitfb71fbb8e8e48047fd6a8f86ad7e59a9846a2784 (patch)
treedc4fe8aff6ad53f48bbdc0f85143336456a17d18 /fpdfsdk/fpdfedittext.cpp
parentc4ecd7b2e10e37a3b29eb380472fbee4936522ac (diff)
downloadpdfium-fb71fbb8e8e48047fd6a8f86ad7e59a9846a2784.tar.xz
Do not include large unicode values in the ToUnicode map
Freetype can get to values larger than 0x10FFFF, but our current implementation of the ToUnicode mapping and the function FXSYS_ToUTF16BE does not support these values. Bug: chromium:724962 Change-Id: I7069f33429527dbf2d0bfd2033512fe909970c02 Reviewed-on: https://pdfium-review.googlesource.com/5810 Commit-Queue: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfedittext.cpp')
-rw-r--r--fpdfsdk/fpdfedittext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfedittext.cpp b/fpdfsdk/fpdfedittext.cpp
index a14f54515f..2dde2e6624 100644
--- a/fpdfsdk/fpdfedittext.cpp
+++ b/fpdfsdk/fpdfedittext.cpp
@@ -317,6 +317,9 @@ void* LoadCompositeFont(CPDF_Document* pDoc,
std::map<uint32_t, uint32_t> to_unicode;
std::map<uint32_t, uint32_t> widths;
while (true) {
+ if (currentChar > 0x10FFFF)
+ break;
+
widths[glyphIndex] = pFont->GetGlyphWidth(glyphIndex);
to_unicode[glyphIndex] = currentChar;
currentChar =