From 6eacb55fc457b2641240311bd65a9f7100e8c4c6 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Mon, 13 May 2019 11:34:15 +0200 Subject: [PATCH] Fix bug preventing startXref to be found for files with a single byte EOL encoding --- src/PDF.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PDF.hs b/src/PDF.hs index e1e7421..0f18b5f 100644 --- a/src/PDF.hs +++ b/src/PDF.hs @@ -182,7 +182,7 @@ readStartXref eolStyle input = BS.length input - BS.length eofMarker - if BS.last input == BS.last eofMarker then 0 else eolOffset startXrefPosition = - previous eolLastByte (eofMarkerPosition - eolOffset) input + 1 + previous eolLastByte (eofMarkerPosition - eolOffset - 1) input + 1 startXrefLength = eofMarkerPosition - eolOffset - startXrefPosition parseDocument :: ByteString -> Either ParseError Document