mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
[Editor] Don't forget to encrypt image streams (see issue #16821)
and encrypt a compressed stream after having been compressed.
This commit is contained in:
parent
d4ba312f00
commit
7a5b3423d6
5 changed files with 51 additions and 6 deletions
|
@ -46,9 +46,6 @@ async function writeDict(dict, buffer, transform) {
|
|||
|
||||
async function writeStream(stream, buffer, transform) {
|
||||
let string = stream.getString();
|
||||
if (transform !== null) {
|
||||
string = transform.encryptString(string);
|
||||
}
|
||||
const { dict } = stream;
|
||||
|
||||
const [filter, params] = await Promise.all([
|
||||
|
@ -106,6 +103,10 @@ async function writeStream(stream, buffer, transform) {
|
|||
}
|
||||
}
|
||||
|
||||
if (transform !== null) {
|
||||
string = transform.encryptString(string);
|
||||
}
|
||||
|
||||
dict.set("Length", string.length);
|
||||
await writeDict(dict, buffer, transform);
|
||||
buffer.push(" stream\n", string, "\nendstream");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue