Skip to content

Commit

Permalink
Fix infinite loop bug when looking for EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnsth committed Feb 11, 2020
1 parent fdee057 commit da431a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ func (parser *PdfParser) seekToEOFMarker(fSize int64) error {
// Define an buffer length in terms of how many bytes to read from the end of the file.
var buflen int64 = 2048

for offset < fSize {
for offset < fSize-4 {
if fSize <= (buflen + offset) {
buflen = fSize - offset
}
Expand Down

0 comments on commit da431a5

Please sign in to comment.