Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4552

Regression on COSWriter in PDFBox 2.0.15

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Duplicate
    • Affects Version/s: 2.0.15
    • Fix Version/s: None
    • Component/s: Writing
    • Labels:

      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 : 

       

      COSArray id = ((COSArray) trailer.getItem(COSName.ID));
      if (id != null) 
      {
          id.setDirect(true);
      }
      

      Best regards,

      M.Véron

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mveron Maxime Veron
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: