Commit b62367ae51d47b41be45351520e2e6ce3ae14717
1 parent
ed2fb6a8
Remove `QPDF::initializeEncryption`.
Showing
2 changed files
with
4 additions
and
7 deletions
libqpdf/QPDF_objects.cc
| ... | ... | @@ -227,7 +227,7 @@ Objects::parse(char const* password) |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - qpdf.initializeEncryption(); | |
| 230 | + m->encp->initialize(qpdf); | |
| 231 | 231 | m->parsed = true; |
| 232 | 232 | if (!m->xref_table.empty() && !qpdf.getRoot().getKey("/Pages").isDictionary()) { |
| 233 | 233 | // QPDFs created from JSON have an empty xref table and no root object yet. |
| ... | ... | @@ -334,15 +334,13 @@ Objects::reconstruct_xref(QPDFExc& e, bool found_startxref) |
| 334 | 334 | auto xref_backup{m->xref_table}; |
| 335 | 335 | try { |
| 336 | 336 | m->file->seek(startxrefs.back(), SEEK_SET); |
| 337 | - if (auto offset = | |
| 338 | - QUtil::string_to_ll(m->objects.readToken(*m->file).getValue().data())) { | |
| 339 | - m->objects.read_xref(offset); | |
| 337 | + if (auto offset = QUtil::string_to_ll(readToken(*m->file).getValue().data())) { | |
| 338 | + read_xref(offset); | |
| 340 | 339 | |
| 341 | 340 | if (qpdf.getRoot().getKey("/Pages").isDictionary()) { |
| 342 | - QTC::TC("qpdf", "QPDF startxref more than 1024 before end"); | |
| 343 | 341 | warn(damagedPDF( |
| 344 | 342 | "", -1, "startxref was more than 1024 bytes before end of file")); |
| 345 | - qpdf.initializeEncryption(); | |
| 343 | + m->encp->initialize(qpdf); | |
| 346 | 344 | m->parsed = true; |
| 347 | 345 | m->reconstructed_xref = false; |
| 348 | 346 | return; | ... | ... |
qpdf/qpdf.testcov
| ... | ... | @@ -27,7 +27,6 @@ main QTest stream 0 |
| 27 | 27 | QPDF lin write nshared_total > nshared_first_page 1 |
| 28 | 28 | QPDFWriter encrypted hint stream 0 |
| 29 | 29 | QPDF xref gen > 0 1 |
| 30 | -QPDF startxref more than 1024 before end 0 | |
| 31 | 30 | QPDFParser bad brace 0 |
| 32 | 31 | QPDFParser bad brace in parseRemainder 0 |
| 33 | 32 | QPDFParser bad array close 0 | ... | ... |