You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2026/01/31 17:34:00 UTC

[jira] [Updated] (PDFBOX-6159) symInRefSize not respected when doing Huffmann decoding

     [ https://issues.apache.org/jira/browse/PDFBOX-6159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr updated PDFBOX-6159:
------------------------------------
    Summary: symInRefSize not respected when doing Huffmann decoding  (was: symInRefSize not respected in Huffmann decoding variant)

> symInRefSize not respected when doing Huffmann decoding
> -------------------------------------------------------
>
>                 Key: PDFBOX-6159
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6159
>             Project: PDFBox
>          Issue Type: Sub-task
>          Components: JBIG2
>    Affects Versions: 3.0.4 JBIG2
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 3.0.5 JBIG2
>
>
> After not progressing with Huffmann related problems (and working on bitmap-symbol-symhuffrefine-textrefine.jbig2), I had a look at the code by Nico Weber
> https://github.com/SerenityOS/serenity/blob/master/Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp#L1560
> he reads symInRefSize bytes into a buffer after reading the size. The oiginal levigo code just decodes and ignores the value, i.e. assumes that it will land at the correct position.
> Thus the start position in my recent change should be another one than the one I assumed (after debugging "good" results), but then many that worked now failed like this:
>     Refinement bitmap bytes expected: 28, bytes read: 26
> So either all these reads are wrong (although look ok), or the amount of bytes reserved is slightly too high, which is harmless.
> Thus I'll change it so that it checks only for an "overshoot" and seeks to the correct position after read.
> And suddenly lots of files were rendered properly!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org