summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSune Vuorela <sune@vuorela.dk>2023-05-12 21:12:43 +0200
committerSune Vuorela <sune@vuorela.dk>2023-05-12 21:12:43 +0200
commit8aaf78b06373e2a641e565c3b9da31ac3a25b7d8 (patch)
treebf98592bdd15191f21a19a8553995541b3f0d688
parent6fd2c2e6f50b6b8f47c554c8e7e3076cd81a7554 (diff)
Skip font lookup for nonprintable characters
This is at least one cause for https://bugs.kde.org/show_bug.cgi?id=469664
-rw-r--r--poppler/Form.cc4
1 files changed, 4 insertions, 0 deletions
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)) {