From 4964bd211911796b57459c1e4e4fe4d7be88051c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Mon, 14 Oct 2013 19:49:01 +0200 Subject: don't fail on invalid object streams At https://code.google.com/p/sumatrapdf/issues/detail?id=2436 , there's a document with an empty xref section which since recently causes a repair to be triggered. Repairs then stop when pdf_repair_obj_stms fails on an object which isn't even required for the document to render. Such broken object streams should rather be ignored same as broken objects are ignored in pdf_init_document. --- source/pdf/pdf-repair.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/pdf/pdf-repair.c b/source/pdf/pdf-repair.c index e9a60986..0e1f0bdf 100644 --- a/source/pdf/pdf-repair.c +++ b/source/pdf/pdf-repair.c @@ -578,14 +578,11 @@ pdf_repair_obj_stms(pdf_document *doc) if (!strcmp(pdf_to_name(pdf_dict_gets(dict, "Type")), "ObjStm")) pdf_repair_obj_stm(doc, i, 0); } - fz_always(ctx) - { - pdf_drop_obj(dict); - } fz_catch(ctx) { - fz_rethrow(ctx); + fz_warn(ctx, "ignoring broken object stream (%d 0 R)", i); } + pdf_drop_obj(dict); } } -- cgit v1.2.3