Some applications write both the "from" and "to" mappings as four digit numbers even though the first two digits of the "from" mapping are always "00". This patch allows poppler to handle files with four digit "from" mappings as long as the "from" value is in range.
Created attachment 26343 [details] [review] suggested patch to poppler-0.10.7/poppler/CharCodeToUnicode.cc
My example file is 3 MB and was too large to post. Contact me by email at williambader@hotmail.com for a copy.
Can you please mail the file to aacid@kde.org?
What do you think of this? diff --git a/poppler/CharCodeToUnicode.cc b/poppler/CharCodeToUnicode.cc index 0cbb4d7..b278d58 100644 --- a/poppler/CharCodeToUnicode.cc +++ b/poppler/CharCodeToUnicode.cc @@ -281,8 +281,11 @@ void CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data, } if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && tok2[0] == '<' && tok2[n2 - 1] == '>')) { - error(-1, "Illegal entry in bfchar block in ToUnicode CMap"); - continue; + if (!(n1 == 4 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && tok1[1] == '0' && tok1[2] == '0' && + tok2[0] == '<' && tok2[n2 - 1] == '>')) { + error(-1, "Illegal entry in bfchar block in ToUnicode CMap"); + continue; + } } tok1[n1 - 1] = tok2[n2 - 1] = '\0'; if (sscanf(tok1 + 1, "%x", &code1) != 1) {
It works for me.
Patch commited, will be in next poppler release
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.