poppler/Form.cc |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 8aaf78b06373e2a641e565c3b9da31ac3a25b7d8
Author: Sune Vuorela <[email protected]>
Date:   Fri May 12 21:12:43 2023 +0200

    Skip font lookup for nonprintable characters
    
    This is at least one cause for
    https://bugs.kde.org/show_bug.cgi?id=469664

diff --git a/poppler/Form.cc b/poppler/Form.cc
index 958ff3e1..1fa748dc 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -2999,6 +2999,10 @@ std::vector<Form::AddFontResult> 
Form::ensureFontsForAllCharacters(const GooStri
         Unicode uChar = (unsigned char)(unicodeText->getChar(i)) << 8;
         uChar += (unsigned char)(unicodeText->getChar(i + 1));
 
+        if (uChar < 128 && !std::isprint(static_cast<unsigned char>(uChar))) {
+            continue;
+        }
+
         CharCode c;
         bool addFont = false;
         if (ccToUnicode->mapToCharCode(&uChar, &c, 1)) {

Reply via email to