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

RandomAccessBuffer returns wrong values for single byte reads, patch attached

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.6.0
    • Component/s: Parsing
    • Labels:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: