summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-interpret.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2014-03-05 12:07:46 +0000
committerRobin Watts <robin.watts@artifex.com>2014-03-17 17:41:16 +0000
commit801c5c0781c81925ae7c7937c8595dcae780bc85 (patch)
treef3726d13534b8cff25275263a6140beb56795586 /source/pdf/pdf-interpret.c
parent2c1ec5347ae7c2b610c33f5cd0a034d9c8345d77 (diff)
downloadmupdf-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-interpret.c')
-rw-r--r--source/pdf/pdf-interpret.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c
index f0271cf3..3984d8e6 100644
--- a/source/pdf/pdf-interpret.c
+++ b/source/pdf/pdf-interpret.c
@@ -324,7 +324,14 @@ pdf_process_stream(pdf_csi *csi, pdf_lexbuf *buf)
break;
case PDF_TOK_NAME:
- fz_strlcpy(csi->name, buf->scratch, sizeof(csi->name));
+ if (csi->name[0])
+ {
+ pdf_drop_obj(csi->obj);
+ csi->obj = NULL;
+ csi->obj = pdf_new_name(csi->doc, buf->scratch);
+ }
+ else
+ fz_strlcpy(csi->name, buf->scratch, sizeof(csi->name));
break;
case PDF_TOK_INT: