diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-08-08 13:22:06 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-08-09 14:02:19 +0200 |
commit | 7f97f80d1a74a50d369b3bdf513de7fbcaed6bc3 (patch) | |
tree | 53989671ab2d900ca1ad9e92641eab9bd9e42054 /source/pdf | |
parent | 9e2886aff8f330f54fb341c98dff3b61163dfc3c (diff) | |
download | mupdf-7f97f80d1a74a50d369b3bdf513de7fbcaed6bc3.tar.xz |
Remove redundant (and incomplete) checks when encountering OCGs.
The checks were duplicated between pdf_process_BDC and pdf_is_hidden_ocg.
The checks in the former function were incomplete: they only checked
the for OCG type objects and incorrectly discarded OCMD type objects.
Remove the checks from pdf_process_BDC and let pdf_is_hidden_ocg handle
all of them instead.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-interpret.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c index 051e0a59..acebdf87 100644 --- a/source/pdf/pdf-interpret.c +++ b/source/pdf/pdf-interpret.c @@ -510,11 +510,8 @@ resolve_properties(fz_context *ctx, pdf_csi *csi, pdf_obj *obj) static void pdf_process_BDC(fz_context *ctx, pdf_processor *proc, pdf_csi *csi) { - pdf_obj *raw = csi->obj; - pdf_obj *cooked = resolve_properties(ctx, csi, raw); - if (proc->op_BDC) - proc->op_BDC(ctx, proc, csi->name, raw, cooked); + proc->op_BDC(ctx, proc, csi->name, csi->obj, resolve_properties(ctx, csi, csi->obj)); /* Already hidden, no need to look further */ if (proc->hidden > 0) @@ -527,15 +524,7 @@ pdf_process_BDC(fz_context *ctx, pdf_processor *proc, pdf_csi *csi) if (strcmp(csi->name, "OC")) return; - /* No Properties array, or name not found, means visible. */ - if (!cooked) - return; - - /* Wrong type of property */ - if (!pdf_name_eq(ctx, pdf_dict_get(ctx, cooked, PDF_NAME_Type), PDF_NAME_OCG)) - return; - - if (pdf_is_hidden_ocg(ctx, csi->doc->ocg, csi->rdb, proc->usage, cooked)) + if (pdf_is_hidden_ocg(ctx, csi->doc->ocg, csi->rdb, proc->usage, csi->obj)) ++proc->hidden; } |