summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2012-07-26 01:18:34 +0200
committerSebastian Rasmussen <sebras@gmail.com>2012-07-26 01:18:34 +0200
commit21ce8630a0ced3c8c167cb7a5cb583dfde896e32 (patch)
tree641519f9f79c7654e618f520fff6e4d7a597c9f2
parent63b4289d48c3872e71588476cafcabbd7f3ae565 (diff)
downloadmupdf-21ce8630a0ced3c8c167cb7a5cb583dfde896e32.tar.xz
Only resize xref if trailer size entry indicate more objects
This will gracefully handle negative size entries as well, as these would not grow the xref.
-rw-r--r--pdf/pdf_xref.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c
index 52db0644..9263eaaf 100644
--- a/pdf/pdf_xref.c
+++ b/pdf/pdf_xref.c
@@ -495,7 +495,8 @@ pdf_load_xref(pdf_document *xref, pdf_lexbuf *buf)
if (!size)
fz_throw(ctx, "trailer missing Size entry");
- pdf_resize_xref(xref, size);
+ if (size > xref->len)
+ pdf_resize_xref(xref, size);
pdf_read_xref_sections(xref, xref->startxref, buf);