summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-07 17:15:54 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-08 13:22:51 +0100
commitb59ff4e3956d8e62b6b76a0e23697b15bc8c9467 (patch)
tree6d92d38087549920b0e6bd70a1c22464a26c0beb /source
parentfb59e97f2a6361ba0ddde3fe4f6765bef075a55d (diff)
downloadmupdf-b59ff4e3956d8e62b6b76a0e23697b15bc8c9467.tar.xz
Fix 698918: Use encryption when doing initial object formatting to count the length.
Diffstat (limited to 'source')
-rw-r--r--source/pdf/pdf-object.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c
index 056d6a73..0c60c228 100644
--- a/source/pdf/pdf-object.c
+++ b/source/pdf/pdf-object.c
@@ -2130,10 +2130,9 @@ int pdf_print_encrypted_obj(fz_context *ctx, fz_output *out, pdf_obj *obj, int t
char *ptr;
int n;
- n = pdf_sprint_obj(ctx, NULL, 0, obj, tight);
- if ((n + 1) < sizeof buf)
+ n = pdf_sprint_encrypted_obj(ctx, buf, sizeof buf, obj, tight, crypt, num, gen);
+ if (n <= sizeof buf)
{
- pdf_sprint_encrypted_obj(ctx, buf, sizeof buf, obj, tight, crypt, num, gen);
fz_write_data(ctx, out, buf, n);
}
else