aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-09-07 22:49:31 +0200
committerJay Berkenbilt <ejb@ql.org>2022-09-08 16:19:38 +0200
commit264e25f391f83bcbeb60590f18ff96719b086454 (patch)
treead7a6daae5a2350d56a521eb022fea30e799b95c /libqpdf/QPDFWriter.cc
parenta615985865ca73249a7b21e2f28b440cb6c16636 (diff)
downloadqpdf-264e25f391f83bcbeb60590f18ff96719b086454.tar.zst
Clear owning QPDF information for all objects, not just indirect
Diffstat (limited to 'libqpdf/QPDFWriter.cc')
-rw-r--r--libqpdf/QPDFWriter.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index 028f73dc..83785465 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -1198,6 +1198,14 @@ void
QPDFWriter::enqueueObject(QPDFObjectHandle object)
{
if (object.isIndirect()) {
+ // This owner check should really be done for all objects, not
+ // just indirect objects. As of the time of the release of
+ // qpdf 11, it is known that there are cases of direct objects
+ // from other files getting copied into multiple QPDF objects.
+ // This definitely happens in the page splitting code. If we
+ // were to implement strong checks to prevent objects from
+ // having multiple owners, once that was complete phased in,
+ // this check could be moved outside the if statement.
if (object.getOwningQPDF() != &(this->m->pdf)) {
QTC::TC("qpdf", "QPDFWriter foreign object");
throw std::logic_error(