diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-11-09 17:29:52 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-11-09 18:33:15 +0100 |
commit | 5508f74603d7a816ab67456939bd3ee57676f842 (patch) | |
tree | e918fef9f6da33f7dc0b8a3c8e69369e29dc0a70 /libqpdf/QPDF_encryption.cc | |
parent | b997fa5343ea42054338b9143b3205cb6c164e6e (diff) | |
download | qpdf-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/QPDF_encryption.cc')
-rw-r--r-- | libqpdf/QPDF_encryption.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc index 5a6735ee..9880face 100644 --- a/libqpdf/QPDF_encryption.cc +++ b/libqpdf/QPDF_encryption.cc @@ -877,7 +877,7 @@ QPDF::initializeEncryption() int R = encryption_dict.getKey("/R").getIntValueAsInt(); std::string O = encryption_dict.getKey("/O").getStringValue(); std::string U = encryption_dict.getKey("/U").getStringValue(); - int P = encryption_dict.getKey("/P").getIntValueAsInt(); + int P = static_cast<int>(encryption_dict.getKey("/P").getIntValue()); // If supporting new encryption R/V values, remember to update // error message inside this if statement. @@ -1448,7 +1448,7 @@ QPDF::isEncrypted(int& R, int& P, int& V, QPDFObjectHandle Pkey = encrypt.getKey("/P"); QPDFObjectHandle Rkey = encrypt.getKey("/R"); QPDFObjectHandle Vkey = encrypt.getKey("/V"); - P = Pkey.getIntValueAsInt(); + P = static_cast<int>(Pkey.getIntValue()); R = Rkey.getIntValueAsInt(); V = Vkey.getIntValueAsInt(); stream_method = this->m->encp->cf_stream; |