summaryrefslogtreecommitdiff
path: root/src/xref.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2018-01-23 22:53:52 +0000
committerVincent Sanders <vince@kyllikki.org>2018-01-23 22:53:52 +0000
commit3fe413e5838eaf9d8bc30a9a49f0d7707e84db35 (patch)
treee8e7b74339736fe8c03975bd91735869192c0f5b /src/xref.c
parent9f0e9af2eeb08abcaa4991ae4e87440dcba2ada1 (diff)
downloadlibnspdf-3fe413e5838eaf9d8bc30a9a49f0d7707e84db35.tar.gz
libnspdf-3fe413e5838eaf9d8bc30a9a49f0d7707e84db35.tar.bz2
add dereference error
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