[Poppler-bugs] [Bug 56226] Poppler does not guard against invalid utf-8

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Oct 27 13:31:26 PDT 2012


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

--- Comment #5 from Benjamin Berg <benjamin at sipsolutions.net> ---
The bug still exists on master, and the patch can easily be updated. I doubt
though that the solution that is used in the patch is acceptable though.


So, I just looked at the PDF a bit more. The image uses font 3.1 (and 7.1) and
the characters are explicitly mapped to the unicode character uFFFF:

Excerpt from the unicode mapping object (stream 695 in the PDF) for the font in
question:
2 beginbfrange
<21><21><ffff>
<22><22><ffff>
endbfrange

This PDF is *broken*. Unicode 0xffff is an invalid character by specification,
and poppler (including master) passes it trough to cairo. And cairo does not
like uFFFF.


So, poppler needs to be more careful, at least when passing the unicode string
to cairo. It would also work to silently change the ffff to eg. fffd
(replacement character) while loading the unicode map. I don't know what the
best solution is here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20121027/2e15a3a3/attachment.html>


More information about the Poppler-bugs mailing list