[ 
https://issues.apache.org/jira/browse/PDFBOX-6080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18023604#comment-18023604
 ] 

Tilman Hausherr commented on PDFBOX-6080:
-----------------------------------------

Proposed changed: in CCITTFaxFilter, add below "if (k == 0)"
{code:java}
if (decodeParms.containsKey(COSName.END_OF_LINE))
{
    boolean hasEndOfLine = decodeParms.getBoolean(COSName.END_OF_LINE, false);
    type = hasEndOfLine ? TIFFExtension.COMPRESSION_CCITT_T4 : 
TIFFExtension.COMPRESSION_CCITT_MODIFIED_HUFFMAN_RLE;
}
else
{
{code}
and add the existing segment into the else part. This means: if the /EndOfLine 
value exit, follow it. If it doesn't exist, use the EOL detection.

[~Schmidor]

> Unknown code in Huffman RLE stream
> ----------------------------------
>
>                 Key: PDFBOX-6080
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6080
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.34, 3.0.5 PDFBox
>            Reporter: Tilman Hausherr
>            Priority: Major
>              Labels: regression
>         Attachments: PDFBOX-6080.pdf, image-2025-09-29-16-00-37-246.png
>
>
> As reported in the users mailing list
> Unknown code in Huffman RLE stream
>     at 
> org.apache.pdfbox.filter.CCITTFaxDecoderStream.decodeRun(CCITTFaxDecoderStream.java:384)
>     at 
> org.apache.pdfbox.filter.CCITTFaxDecoderStream.decode1D(CCITTFaxDecoderStream.java:164)
>     at 
> org.apache.pdfbox.filter.CCITTFaxDecoderStream.decodeRowType4(CCITTFaxDecoderStream.java:293)
>     at 
> org.apache.pdfbox.filter.CCITTFaxDecoderStream.decodeRow(CCITTFaxDecoderStream.java:313)
>     at 
> org.apache.pdfbox.filter.CCITTFaxDecoderStream.fetch(CCITTFaxDecoderStream.java:131)
>     at 
> org.apache.pdfbox.filter.CCITTFaxDecoderStream.read(CCITTFaxDecoderStream.java:452)
>     at 
> org.apache.pdfbox.filter.CCITTFaxFilter.readFromDecoderStream(CCITTFaxFilter.java:131)
>     at org.apache.pdfbox.filter.CCITTFaxFilter.decode(CCITTFaxFilter.java:109)
>     at org.apache.pdfbox.filter.Filter.decode(Filter.java:97)
>     at org.apache.pdfbox.filter.Filter.decode(Filter.java:285)
> It worked in 1.8, 2.0.22 (released 19.12.2020) and stopped working in 2.0.23 
> (released 18.3.2021). It has never worked in 3.0.



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

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

Reply via email to