[Poppler-bugs] [Bug 30521] New: Illegal entry in bfrange block in ToUnicode CMap

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 30 16:09:54 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=30521

           Summary: Illegal entry in bfrange block in ToUnicode CMap
           Product: poppler
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: poppler-bugs at lists.freedesktop.org
        ReportedBy: williambader at hotmail.com


Created an attachment (id=39087)
 --> (https://bugs.freedesktop.org/attachment.cgi?id=39087)
proposed patch

pdftops (as copied from git on 30 Sep 2010) gets "Illegal entry in bfrange
block in ToUnicode CMap" on what I think is a valid file.
I had a PDF file and compressed it with ps2pdf from ghostscript 9.00.
When I run the resulting PDF through poppler's pdftops, I get the errors.
I have attached patches that show more information and that stop the message.
The messages (before the change to fix them) look like the example below.
Error: Illegal entry in bfrange block in ToUnicode CMap, nBits 16 nDigits 4,
found '<45>' '<46>'
The PDF has a 16 bit table, but the values have only two hex digits, and
poppler isn't parsing it correctly.
In poppler-30sep10/poppler/CharCodeToUnicode.cc, I made the change
        if (!(((n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>') ||
+              (nDigits > 2 && n1 == 2 + 2 && tok1[0] == '<' && tok1[2 + 2 - 1]
== '>') ||
               (n1 == 4 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
tok1[1] == '0' && tok1[2] == '0')) &&
              ((n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>') ||
+              (nDigits > 2 && n2 == 2 + 2 && tok2[0] == '<' && tok2[2 + 2 - 1]
== '>') ||
               (n2 == 4 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>' &&
tok1[1] == '0' && tok1[2] == '0')))) {
-         error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+         error(-1, "Illegal entry in bfrange block in ToUnicode CMap, nBits %d
nDigits %d, found '%.*s' '%.*s'", nBits, nDigits, n1, tok1, n2, tok2);
          continue;
        }

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list