THausherr commented on pull request #107:
URL: https://github.com/apache/pdfbox/pull/107#issuecomment-997278739


   Good find. I think this can be fixed by changing the code to be like this:
   ```
               else if (counter > 0)
               {
                   counter = 0;
                   source.seek(position + 1);
                   position = -1L;
                   //continue;
               }
   ```
   The code is used only when we do a brute force search on broken PDFs. If a 
PDF would contain "%%%EOF" then "%%EOF" wouldn't be found with the existing 
code. The perfect solution would be 
   https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm
   but that would need more time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to