[
https://issues.apache.org/jira/browse/PDFBOX-3605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15706025#comment-15706025
]
ASF subversion and git services commented on PDFBOX-3605:
---------------------------------------------------------
Commit 1771933 from [~tilman] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1771933 ]
PDFBOX-3605: return -1 on EOF, as suggested by Cameron Rollheiser
> Infinite Read Loop
> ------------------
>
> Key: PDFBOX-3605
> URL: https://issues.apache.org/jira/browse/PDFBOX-3605
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 2.0.3
> Reporter: Cameron Rollheiser
>
> When reading an input file using the BufferedRandomAccesssFile an infinite
> loop will occur once the buffer is drained and the value leftover becomes 0,
> since the read method will continue to return 0 as the -1 result from
> fillBuffer() is never propagated upstream and any code that is executing in a
> loop using -1 as an indicator that the file has been fully read will never
> exit.
> An example of where this occurs can be found here:
> https://github.com/apache/pdfbox/blob/782ac20dcea7b2e5bb6848f4da9a68c00b4d69a3/fontbox/src/main/java/org/apache/fontbox/ttf/TTFDataStream.java#L264
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]