From 9b28933647f0a3ed535dd488c4526b75d1c10fc6 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 4 Nov 2021 11:55:36 -0400 Subject: Check object ownership when adding When adding a QPDFObjectHandle to an array or dictionary, if possible, check if the new object belongs to the same QPDF. This makes it much easier to find incorrect code than waiting for the situation to be detected when the file is written. --- include/qpdf/QPDFObjectHandle.hh | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index e57179b5..2f2b3ebc 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -1336,6 +1336,7 @@ class QPDFObjectHandle std::vector arrayOrStreamToStreamArray( std::string const& description, std::string& all_description); static void warn(QPDF*, QPDFExc const&); + void checkOwnership(QPDFObjectHandle const&) const; bool initialized; -- cgit v1.2.3-54-g00ecf