aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index c650bdea..6d4f10ce 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -3194,6 +3194,12 @@ QPDFObjectHandle::dereference()
throw std::logic_error(
"attempted to dereference an uninitialized QPDFObjectHandle");
}
+ if (this->obj.getPointer() && this->objid &&
+ QPDF::Resolver::objectChanged(
+ this->qpdf, QPDFObjGen(this->objid, this->generation), this->obj))
+ {
+ this->obj = nullptr;
+ }
if (this->obj.getPointer() == 0)
{
PointerHolder<QPDFObject> obj = QPDF::Resolver::resolve(