You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Lars Torunski (JIRA)" <ji...@apache.org> on 2011/04/29 23:19:03 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=13027194#comment-13027194 ]
Lars Torunski commented on PDFBOX-821:
--------------------------------------
RandomAccessBuffer usage was introduced with PDFBOX-948. Hopefully switching the default to in-memory scratch buffers in 1.5.0 doesn't raised a problem.
> 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
> 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