Skip to content

Commit

Permalink
Fix reading PDF files whose trailer is missing a newline (Issue #80)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Dec 9, 2024
1 parent 2ea9959 commit d705d7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ v1.4.0 - YYYY-MM-DD
- Added new `pdfioFileCreateNameObj` and `pdfioObjGetName` APIs for creating and
getting name object values (Issue #76)
- Updated documentation (Issue #78)
- Fixed reading of PDF files whose trailer is missing a newline (Issue #80)


v1.3.2 - 2024-08-15
Expand Down
2 changes: 1 addition & 1 deletion pdfio-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ load_xref(
{
PDFIO_DEBUG("load_xref: '%s' at offset %lu\n", line, (unsigned long)trailer_offset);

if (!strncmp(line, "trailer", 7) && (!line[7] || isspace(line[7] & 255)))
if (!strncmp(line, "trailer", 7) && (!line[7] || isspace(line[7] & 255) || line[7] == '<'))
{
if (line[7])
{
Expand Down

0 comments on commit d705d7e

Please sign in to comment.