From fb71fbb8e8e48047fd6a8f86ad7e59a9846a2784 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 23 May 2017 13:16:09 -0400 Subject: Do not include large unicode values in the ToUnicode map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/fpdfedittext.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fpdfsdk/fpdfedittext.cpp') 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 to_unicode; std::map widths; while (true) { + if (currentChar > 0x10FFFF) + break; + widths[glyphIndex] = pFont->GetGlyphWidth(glyphIndex); to_unicode[glyphIndex] = currentChar; currentChar = -- cgit v1.2.3