summaryrefslogtreecommitdiff
path: root/src/xref.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xref.c')
-rw-r--r--src/xref.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xref.c b/src/xref.c
index 7780bf2..6218fac 100644
--- a/src/xref.c
+++ b/src/xref.c
@@ -160,6 +160,11 @@ nspdf__xref_get_referenced(struct nspdf_doc *doc, struct cos_object **cobj_out)
return NSPDFERROR_OK;
}
+ if (doc == NULL) {
+ /* a reference with no document to dereference against */
+ return NSPDFERROR_REFERENCE;
+ }
+
entry = doc->xref_table + cobj->u.reference->id;
/* check if referenced object is in range and exists. return null object if