From 485058dbc22c2b181bd044bae9721224f016d568 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 31 Mar 2015 19:42:57 +0100 Subject: Bug 693719: Improve repairing of files with broken trailers. When repairing a file we keep track of the most recent 'Root' entry we have found. Only accept a new Root entry as a replacement if it is a dictionary. --- source/pdf/pdf-repair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/pdf/pdf-repair.c b/source/pdf/pdf-repair.c index 3c149177..8881c50f 100644 --- a/source/pdf/pdf-repair.c +++ b/source/pdf/pdf-repair.c @@ -418,7 +418,7 @@ pdf_repair_xref(fz_context *ctx, pdf_document *doc) } obj = pdf_dict_get(ctx, dict, PDF_NAME_Root); - if (obj) + if (pdf_is_dict(ctx, obj)) { pdf_drop_obj(ctx, root); root = pdf_keep_obj(ctx, obj); -- cgit v1.2.3