summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2013-10-14 19:49:01 +0200
committerRobin Watts <robin.watts@artifex.com>2014-01-01 12:30:03 +0000
commit4964bd211911796b57459c1e4e4fe4d7be88051c (patch)
tree12e17636aa477ef7ae9ef97278aa7a13ae2aa377
parent544581f1157f88679ca6f9a0c984592ea8d93bcf (diff)
downloadmupdf-4964bd211911796b57459c1e4e4fe4d7be88051c.tar.xz
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.
-rw-r--r--source/pdf/pdf-repair.c7
1 files changed, 2 insertions, 5 deletions
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);
}
}