aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-11-09 17:29:52 +0100
committerJay Berkenbilt <ejb@ql.org>2019-11-09 18:33:15 +0100
commit5508f74603d7a816ab67456939bd3ee57676f842 (patch)
treee918fef9f6da33f7dc0b8a3c8e69369e29dc0a70 /libqpdf/QPDFWriter.cc
parentb997fa5343ea42054338b9143b3205cb6c164e6e (diff)
downloadqpdf-5508f74603d7a816ab67456939bd3ee57676f842.tar.zst
Allow /P in encryption dictionary to be positive (fixes #382)
Even though this is disallowed by the spec, files like this have been encountered in the wild.
Diffstat (limited to 'libqpdf/QPDFWriter.cc')
-rw-r--r--libqpdf/QPDFWriter.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index a31f5da9..7b769ae4 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -762,7 +762,7 @@ QPDFWriter::copyEncryptionParameters(QPDF& qpdf)
V,
encrypt.getKey("/R").getIntValueAsInt(),
key_len,
- encrypt.getKey("/P").getIntValueAsInt(),
+ static_cast<int>(encrypt.getKey("/P").getIntValue()),
encrypt.getKey("/O").getStringValue(),
encrypt.getKey("/U").getStringValue(),
OE,