summaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-03-22 00:29:26 +0100
committerJay Berkenbilt <ejb@ql.org>2021-03-22 00:35:23 +0100
commita77f58142d07c5482c90f5ce0e3dbb9c98451c2a (patch)
treee330a2a5945e00e51233ed0fc4fcbeeb8fba02ee /libqpdf
parent3f05429cc559a8cf4b87f98c6b0e416d3183228d (diff)
downloadqpdf-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')
-rw-r--r--libqpdf/QPDF_pages.cc4
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);