summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-03-14 15:27:24 +0000
committerRobin Watts <robin.watts@artifex.com>2012-03-14 15:41:01 +0000
commit7dbaba9d3215aedf803129b9e4cae5f1d02ce2b0 (patch)
treeab351b97bc91023d2c693595b1e22304b80ff241 /pdf
parent215a89a88c095041b862d535943b9be579db6417 (diff)
downloadmupdf-7dbaba9d3215aedf803129b9e4cae5f1d02ce2b0.tar.xz
Warn not throw on indirection cycles in pdf_resolve_indirect.
When we fail to be able to cache an object, we warn and return NULL. An indirection cycle should probably be treated the same way. From SumatraMuPDF.patch - Many thanks.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_xref.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c
index e0e9f190..ffdc435e 100644
--- a/pdf/pdf_xref.c
+++ b/pdf/pdf_xref.c
@@ -1050,7 +1050,10 @@ pdf_resolve_indirect(pdf_obj *ref)
while (pdf_is_indirect(ref))
{
if (--sanity == 0)
- fz_throw(ctx, "Too many indirections (possible indirection cycle involving %d %d R)", num, gen);
+ {
+ fz_warn(ctx, "Too many indirections (possible indirection cycle involving %d %d R)", num, gen);
+ return NULL;
+ }
xref = pdf_get_indirect_document(ref);
if (!xref)
return NULL;