diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-05 01:56:48 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-05 01:56:48 +0200 |
commit | 61226c48df68fba170637f3b5ee654854d01c6ea (patch) | |
tree | 3418a6c732a7d053db8a4136412a749c2192eb1f | |
parent | eceec9ae1c6aaa0ac222fa495d6c224d9b9d4e65 (diff) | |
download | mupdf-61226c48df68fba170637f3b5ee654854d01c6ea.tar.xz |
pdf: Fix segfault in pdf_is_hidden_ocg.
-rw-r--r-- | pdf/pdf_interpret.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c index 81848709..3c183b43 100644 --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -156,12 +156,12 @@ pdf_free_csi(pdf_csi *csi) } static int -pdf_is_hidden_ocg(pdf_csi *csi, fz_obj *xobj) +pdf_is_hidden_ocg(fz_obj *xobj, char *target) { char target_state[16]; fz_obj *obj; - fz_strlcpy(target_state, csi->target, sizeof target_state); + fz_strlcpy(target_state, target, sizeof target_state); fz_strlcat(target_state, "State", sizeof target_state); obj = fz_dict_gets(xobj, "OC"); @@ -169,7 +169,7 @@ pdf_is_hidden_ocg(pdf_csi *csi, fz_obj *xobj) if (fz_is_array(obj)) obj = fz_array_get(obj, 0); obj = fz_dict_gets(obj, "Usage"); - obj = fz_dict_gets(obj, csi->target); + obj = fz_dict_gets(obj, target); obj = fz_dict_gets(obj, target_state); return !strcmp(fz_to_name(obj), "OFF"); } @@ -567,7 +567,7 @@ static fz_error pdf_run_Do(pdf_csi *csi, fz_obj *rdb) if (!fz_is_name(subtype)) return fz_throw("no XObject subtype specified"); - if (pdf_is_hidden_ocg(csi, obj)) + if (pdf_is_hidden_ocg(obj, csi->target)) return fz_okay; if (!strcmp(fz_to_name(subtype), "Form") && fz_dict_gets(obj, "Subtype2")) @@ -1430,7 +1430,7 @@ pdf_run_page_with_usage(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matri if (flags & (1 << 5)) /* NoView */ continue; - if (pdf_is_hidden_ocg(csi, annot->obj)) + if (pdf_is_hidden_ocg(annot->obj, target)) continue; csi = pdf_new_csi(xref, dev, ctm, target); |