From 131da04f4c660feba409117f19613bf97cbdb437 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 18 Dec 2016 17:18:08 +0100 Subject: Make pdf_trailer() return NULL if there is no xref. --- source/pdf/pdf-xref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 43fd3ea4..6db54472 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -139,7 +139,7 @@ pdf_obj *pdf_trailer(fz_context *ctx, pdf_document *doc) /* Return the document's final trailer */ pdf_xref *xref = &doc->xref_sections[0]; - return xref->trailer; + return xref ? xref->trailer : NULL; } void pdf_set_populating_xref_trailer(fz_context *ctx, pdf_document *doc, pdf_obj *trailer) -- cgit v1.2.3