diff options
author | Robin Watts <robin.watts@artifex.com> | 2014-03-05 12:07:46 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2014-03-17 17:41:16 +0000 |
commit | 801c5c0781c81925ae7c7937c8595dcae780bc85 (patch) | |
tree | f3726d13534b8cff25275263a6140beb56795586 /source/pdf/pdf-op-run.c | |
parent | 2c1ec5347ae7c2b610c33f5cd0a034d9c8345d77 (diff) | |
download | mupdf-801c5c0781c81925ae7c7937c8595dcae780bc85.tar.xz |
Ensure that BDC operators get both params.
Currently, when parsing, each time we encounter a name, we throw away
the last name we had. BDC operators are called with:
/Name <object> BDC
If the <object> is a name, we lose the original /Name.
To fix this, parsing a name when we already have a name will cause
the name to be stored as an object.
This has various knock on effects throughout the code to read from
csi->obj rather than csi->name.
Also, ensure that when cleaning, we collect a list of the object
names in our new resources dictionary.
Diffstat (limited to 'source/pdf/pdf-op-run.c')
-rw-r--r-- | source/pdf/pdf-op-run.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c index 22dc76f2..f6eda706 100644 --- a/source/pdf/pdf-op-run.c +++ b/source/pdf/pdf-op-run.c @@ -1697,6 +1697,10 @@ static void pdf_run_BDC(pdf_csi *csi, void *state) pdf_obj *ocg; pdf_obj *rdb = csi->rdb; + /* We only understand OC groups so far */ + if (strcmp(csi->name, "OC") != 0) + return; + /* If we are already in a hidden OCG, then we'll still be hidden - * just increment the depth so we pop back to visibility when we've * seen enough EDCs. */ @@ -1706,7 +1710,13 @@ static void pdf_run_BDC(pdf_csi *csi, void *state) return; } - ocg = pdf_dict_gets(pdf_dict_gets(rdb, "Properties"), csi->name); + if (pdf_is_name(csi->obj)) + { + ocg = pdf_dict_gets(pdf_dict_gets(rdb, "Properties"), pdf_to_name(csi->obj)); + } + else + ocg = csi->obj; + if (!ocg) { /* No Properties array, or name not found in the properties |