diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 5 | ||||
-rw-r--r-- | libqpdf/SparseOHArray.cc | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 6240395d..c58675a4 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -263,9 +263,10 @@ QPDFObjectHandle::isBool() } bool -QPDFObjectHandle::isResolvedNull() const +QPDFObjectHandle::isDirectNull() const { - return QPDFObjectTypeAccessor<QPDF_Null>::check(m->obj.getPointer()); + return (this->m->initialized && (this->m->objid == 0) && + QPDFObjectTypeAccessor<QPDF_Null>::check(m->obj.getPointer())); } bool diff --git a/libqpdf/SparseOHArray.cc b/libqpdf/SparseOHArray.cc index 76c7c224..05b44ee0 100644 --- a/libqpdf/SparseOHArray.cc +++ b/libqpdf/SparseOHArray.cc @@ -15,7 +15,7 @@ SparseOHArray::size() const void SparseOHArray::append(QPDFObjectHandle oh) { - if (! oh.isResolvedNull()) + if (! oh.isDirectNull()) { this->elements[this->n_elements] = oh; } @@ -73,7 +73,7 @@ SparseOHArray::setAt(size_t idx, QPDFObjectHandle oh) { throw std::logic_error("bounds error setting item in SparseOHArray"); } - if (oh.isResolvedNull()) + if (oh.isDirectNull()) { this->elements.erase(idx); } |