summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/pdf/pdf-xref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 32225998..c5b37127 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -332,7 +332,7 @@ static void ensure_incremental_xref(fz_context *ctx, pdf_document *doc)
fz_try(ctx)
{
sub = fz_malloc_struct(ctx, pdf_xref_subsec);
- trailer = pdf_copy_dict(ctx, xref->trailer);
+ trailer = xref->trailer ? pdf_copy_dict(ctx, xref->trailer) : NULL;
doc->xref_sections = fz_resize_array(ctx, doc->xref_sections, doc->num_xref_sections + 1, sizeof(pdf_xref));
xref = &doc->xref_sections[0];
pxref = &doc->xref_sections[1];