You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Maxime Veron (JIRA)" <ji...@apache.org> on 2019/05/27 07:54:00 UTC
[jira] [Updated] (PDFBOX-4552) Regression on COSWriter in PDFBox
2.0.15
[ https://issues.apache.org/jira/browse/PDFBOX-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maxime Veron updated PDFBOX-4552:
---------------------------------
Description:
In method _doWriteTrailer_ an unsafe setter is called on _getItem(COSName.ID).setDirect(true)_.
It was not done in PDFBox 2.0.14. This causes NPEs.
My quick and easy fix to restore PDFBox 2.0.14 behavior :
{code:java}
COSArray id = ((COSArray) trailer.getItem(COSName.ID));
if (id != null)
{
id.setDirect(true);
}
{code}
Best regards,
M.Véron
was:
In method _doWriteTrailer_ an unsafe setter is called on _getItem(COSName.ID).setDirect(true)_.
It was not done in PDFBox 2.0.14.
My quick and easy fix to restore PDFBox 2.0.14 behavior :
{code:java}
COSArray id = ((COSArray) trailer.getItem(COSName.ID));
if (id != null)
{
id.setDirect(true);
}
{code}
Best regards,
M.Véron
> Regression on COSWriter in PDFBox 2.0.15
> ----------------------------------------
>
> Key: PDFBOX-4552
> URL: https://issues.apache.org/jira/browse/PDFBOX-4552
> Project: PDFBox
> Issue Type: Bug
> Components: Writing
> Affects Versions: 2.0.15
> Reporter: Maxime Veron
> Priority: Blocker
>
> In method _doWriteTrailer_ an unsafe setter is called on _getItem(COSName.ID).setDirect(true)_.
>
> It was not done in PDFBox 2.0.14. This causes NPEs.
> My quick and easy fix to restore PDFBox 2.0.14 behavior :
>
> {code:java}
> COSArray id = ((COSArray) trailer.getItem(COSName.ID));
> if (id != null)
> {
> id.setDirect(true);
> }
> {code}
> Best regards,
> M.Véron
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org