From 1081e59243303d6c045c9aca67d5931c000a765b Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 23 Sep 2013 17:08:10 +0100 Subject: Bug 694653: Watch for xref being NULL in pdf_xref_len This can occur early on during xref repair. --- source/pdf/pdf-xref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index aaa79bf3..01a584e3 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -98,7 +98,7 @@ int pdf_xref_len(pdf_document *doc) /* Return the length of the document's final xref section */ pdf_xref *xref = &doc->xref_sections[0]; - return xref->len; + return xref == NULL ? 0 : xref->len; } /* Used while reading the individual xref sections from a file */ -- cgit v1.2.3