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

Regression on COSWriter in PDFBox 2.0.15

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 2.0.15
    • None
    • Writing

    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

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

              Dates

                Created:
                Updated:
                Resolved: