diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-03-22 00:29:26 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-03-22 00:35:23 +0100 |
commit | a77f58142d07c5482c90f5ce0e3dbb9c98451c2a (patch) | |
tree | e330a2a5945e00e51233ed0fc4fcbeeb8fba02ee /libqpdf/QPDF_pages.cc | |
parent | 3f05429cc559a8cf4b87f98c6b0e416d3183228d (diff) | |
download | qpdf-a77f58142d07c5482c90f5ce0e3dbb9c98451c2a.tar.zst |
Remove some assertions that are not necessarily true (fixes #514)
Operations that add the same object to multiple places in the pages
tree are throwing exceptions and then later causing assertion
failures. The assert calls shouldn't be there.
Diffstat (limited to 'libqpdf/QPDF_pages.cc')
-rw-r--r-- | libqpdf/QPDF_pages.cc | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/libqpdf/QPDF_pages.cc b/libqpdf/QPDF_pages.cc index 931ee12b..2d778415 100644 --- a/libqpdf/QPDF_pages.cc +++ b/libqpdf/QPDF_pages.cc @@ -255,13 +255,11 @@ QPDF::insertPage(QPDFObjectHandle newpage, int pos) int npages = kids.getArrayNItems(); pages.replaceKey("/Count", QPDFObjectHandle::newInteger(npages)); this->m->all_pages.insert(this->m->all_pages.begin() + pos, newpage); - assert(this->m->all_pages.size() == QIntC::to_size(npages)); for (int i = pos + 1; i < npages; ++i) { insertPageobjToPage(this->m->all_pages.at(toS(i)), i, false); } insertPageobjToPage(newpage, pos, true); - assert(this->m->pageobj_to_pages_pos.size() == QIntC::to_size(npages)); } void @@ -280,9 +278,7 @@ QPDF::removePage(QPDFObjectHandle page) int npages = kids.getArrayNItems(); pages.replaceKey("/Count", QPDFObjectHandle::newInteger(npages)); this->m->all_pages.erase(this->m->all_pages.begin() + pos); - assert(this->m->all_pages.size() == QIntC::to_size(npages)); this->m->pageobj_to_pages_pos.erase(page.getObjGen()); - assert(this->m->pageobj_to_pages_pos.size() == QIntC::to_size(npages)); for (int i = pos; i < npages; ++i) { insertPageobjToPage(this->m->all_pages.at(toS(i)), i, false); |