diff options
Diffstat (limited to 'source/pdf/pdf-repair.c')
-rw-r--r-- | source/pdf/pdf-repair.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/pdf/pdf-repair.c b/source/pdf/pdf-repair.c index 1193a45c..7e35c5fb 100644 --- a/source/pdf/pdf-repair.c +++ b/source/pdf/pdf-repair.c @@ -204,7 +204,7 @@ pdf_repair_obj_stm(pdf_document *doc, int num, int gen) fz_warn(ctx, "ignoring object with invalid object number (%d %d R)", n, i); continue; } - else if (n > MAX_OBJECT_NUMBER) + else if (n >= pdf_xref_len(doc)) { fz_warn(ctx, "ignoring object with invalid object number (%d %d R)", n, i); continue; @@ -455,7 +455,9 @@ pdf_repair_xref(pdf_document *doc, pdf_lexbuf *buf) Dummy access to entry to assure sufficient space in the xref table and avoid repeated reallocs in the loop */ - (void)pdf_get_populating_xref_entry(doc, maxnum); + /* Ensure that the first xref table is a 'solid' one from + * 0 to maxnum. */ + pdf_ensure_solid_xref(doc, maxnum); for (i = 0; i < listlen; i++) { |