Hi,

Am 01.05.2011 16:29, schrieb Kevin Jackson:
The submitted change has two major problems:
1) A regression for PDFBOX-946.  The size should start at 0
Hmm, the size refers to the size/number of written bytes and not to the size of the buffer, ins't it?

2) The read should post-increment the pointer but now does a pre-increment.
Yes, you're correct, my fault.

Thanks for the hint! I'll fix that immediately...

Kevin Jackson

-----Original Message-----
From: Andreas Lehmkühler (JIRA) [mailto:[email protected]]
Sent: Sunday, May 01, 2011 10:09 AM
To: [email protected]
Subject: [jira] [Resolved] (PDFBOX-821) RandomAccessBuffer returns wrong values 
for single byte reads, patch attached


      [ 
https://issues.apache.org/jira/browse/PDFBOX-821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Lehmkühler resolved PDFBOX-821.
---------------------------------------

        Resolution: Fixed
     Fix Version/s: 1.6.0
          Assignee: Andreas Lehmkühler

I added the patch in revision 1098307 as proposed by Timo Boehme.

Thanks for the contribution to Timo and thanks to Lars for the pointer!

RandomAccessBuffer returns wrong values for single byte reads, patch attached
-----------------------------------------------------------------------------

                 Key: PDFBOX-821
                 URL: https://issues.apache.org/jira/browse/PDFBOX-821
             Project: PDFBox
          Issue Type: Bug
          Components: Parsing
    Affects Versions: 1.3.1
            Reporter: Timo Boehme
            Assignee: Andreas Lehmkühler
             Fix For: 1.6.0

         Attachments: pdfbox_issue821.patch


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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

BR
Andreas Lehmkühler

Reply via email to