summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-op-filter.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-04-13 17:02:43 +0100
committerRobin Watts <robin.watts@artifex.com>2016-04-18 10:51:22 +0100
commit335798189cbd40cd518ce49d1fa4c7eaa2811977 (patch)
tree6436a89506c79174882cc08f0766f328315c1c94 /source/pdf/pdf-op-filter.c
parentbf73ce40b26317cc067239c0e183ea4257a25c2f (diff)
downloadmupdf-335798189cbd40cd518ce49d1fa4c7eaa2811977.tar.xz
Fix broken documents after sanitize
The DP and BDC operators, are used in the form: <NAME> <PROPERTIES> <OPERATOR> where <PROPERTIES> can either be a name (that can be looked up to get a dictionary) or an inline dictionary. What the spec doesn't say is that the two are not interchangeable. If you resolve the name to an inline dict, then insert it, Acrobat will give an error for some (but not all) cases. The interpreter currently resolves any references, and passes the resolved version into the operator handling function. This precludes us outputting the original form. We therefore update it to pass both the raw and the cooked versions in. This has no effect on MuPDFs own handling of anything, it just enables the buffer device to output a correct stream.
Diffstat (limited to 'source/pdf/pdf-op-filter.c')
-rw-r--r--source/pdf/pdf-op-filter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/pdf/pdf-op-filter.c b/source/pdf/pdf-op-filter.c
index 24644a37..a8496e35 100644
--- a/source/pdf/pdf-op-filter.c
+++ b/source/pdf/pdf-op-filter.c
@@ -1047,12 +1047,12 @@ pdf_filter_MP(fz_context *ctx, pdf_processor *proc, const char *tag)
}
static void
-pdf_filter_DP(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *properties)
+pdf_filter_DP(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked)
{
pdf_filter_processor *p = (pdf_filter_processor*)proc;
filter_flush(ctx, p, 0);
if (p->chain->op_DP)
- p->chain->op_DP(ctx, p->chain, tag, properties);
+ p->chain->op_DP(ctx, p->chain, tag, raw, cooked);
}
static void
@@ -1065,12 +1065,12 @@ pdf_filter_BMC(fz_context *ctx, pdf_processor *proc, const char *tag)
}
static void
-pdf_filter_BDC(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *properties)
+pdf_filter_BDC(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked)
{
pdf_filter_processor *p = (pdf_filter_processor*)proc;
filter_flush(ctx, p, 0);
if (p->chain->op_BDC)
- p->chain->op_BDC(ctx, p->chain, tag, properties);
+ p->chain->op_BDC(ctx, p->chain, tag, raw, cooked);
}
static void