summaryrefslogtreecommitdiff
path: root/pdf/pdf_outline.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-22 10:38:48 +0000
committerRobin Watts <robin@ghostscript.com>2011-12-22 10:41:57 +0000
commit3145e49a9ce16d45bf4d6bb01c64646f41d70e8f (patch)
tree7bb42208bc4c841ea11b2f9c55b5140fec304a26 /pdf/pdf_outline.c
parentfef4974f61698e929eb9be2a417fd3743bbd5d35 (diff)
downloadmupdf-3145e49a9ce16d45bf4d6bb01c64646f41d70e8f.tar.xz
Fix Bug 692756: SEGVs in pdf_annot and pdf_outline
A couple of bits of the code SEGV in the event that values are NULL. Fixed here by converting a do...while to a while, and adding an extra guard in the if. Thanks to Gaetan Bisson for the report, and patch.
Diffstat (limited to 'pdf/pdf_outline.c')
-rw-r--r--pdf/pdf_outline.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/pdf_outline.c b/pdf/pdf_outline.c
index a194178c..8a33d8e2 100644
--- a/pdf/pdf_outline.c
+++ b/pdf/pdf_outline.c
@@ -26,7 +26,7 @@ pdf_load_outline_imp(pdf_xref *xref, fz_obj *dict)
if (fz_dict_gets(dict, "Dest") || fz_dict_gets(dict, "A"))
{
link = pdf_load_link(xref, dict);
- if (link->kind == PDF_LINK_GOTO)
+ if (link && link->kind == PDF_LINK_GOTO)
node->page = pdf_find_page_number(xref, fz_array_get(link->dest, 0));
pdf_free_link(xref->ctx, link);
}