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

RandomAccessBuffer returns wrong values for single byte reads, patch attached

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.1
    • 1.6.0
    • Parsing
    • None

    Description

      RandomAccessBuffer contains a critical bug which had no effect so far since this class is currently not used. The problem is in method read() (single byte read). If the byte read is larger than 127 the method returns the signed byte value instead of the unsigned values 128-255. Thus a component using this method will assume end-of-stream.
      The solution is to 'AND' the value with 0xff. Patch is attached.

      Attachments

        1. pdfbox_issue821.patch
          0.5 kB
          Timo Boehme

        Activity

          People

            lehmi Andreas Lehmkühler
            tboehme Timo Boehme
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: