diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-14 17:56:37 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-14 17:56:37 +0200 |
commit | 8b82af386c30474c0a7171df12bd1fba0759d486 (patch) | |
tree | 47defdb6797f5e635968ce67033c8ca2fb775665 /pdf | |
parent | 59bb5110e78bf15f41a58af80d716a76f3722b94 (diff) | |
download | mupdf-8b82af386c30474c0a7171df12bd1fba0759d486.tar.xz |
Fix bug #692153: skip PDF version marker when repairing.
The file in question is missing newlines, causing the first two
objects to be hidden because we treat the %PDF-1.3 version marker
as a comment.
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdf_repair.c | 2 | ||||
-rw-r--r-- | pdf/pdf_xref.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pdf/pdf_repair.c b/pdf/pdf_repair.c index 07110c2d..32dcf2b4 100644 --- a/pdf/pdf_repair.c +++ b/pdf/pdf_repair.c @@ -222,7 +222,7 @@ pdf_repair_xref(pdf_xref *xref, char *buf, int bufsize) { if (memcmp(buf + i, "%PDF", 4) == 0) { - fz_seek(xref->file, i, 0); + fz_seek(xref->file, i + 7, 0); /* skip "%PDF-X.Y" */ break; } } diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c index 60b0f2d6..a0a198e0 100644 --- a/pdf/pdf_xref.c +++ b/pdf/pdf_xref.c @@ -175,7 +175,7 @@ pdf_resize_xref(pdf_xref *xref, int newlen) xref->table = fz_realloc(xref->table, newlen, sizeof(pdf_xref_entry)); for (i = xref->len; i < newlen; i++) { - xref->table[i].type = 0; + xref->table[i].type = 'f'; xref->table[i].ofs = 0; xref->table[i].gen = 0; xref->table[i].stm_ofs = 0; |