diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-11-04 17:11:48 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-11-04 17:29:42 +0100 |
commit | 4a648b9a00d2c4de37bf17165b20a1fc32956eee (patch) | |
tree | b5e774eaf4374dd1973b8a2d7cd9a837d53812ab /libqpdf/QPDFAcroFormDocumentHelper.cc | |
parent | 9b28933647f0a3ed535dd488c4526b75d1c10fc6 (diff) | |
download | qpdf-4a648b9a00d2c4de37bf17165b20a1fc32956eee.tar.zst |
Fix bug in merging resources /DR from foreign AcroForm (fixes #548)
When making resources indirect in from_dr, the code was using the
wrong owning QPDF, forgetting that from_dr had already been copied
using CopyForeignObject.
Diffstat (limited to 'libqpdf/QPDFAcroFormDocumentHelper.cc')
-rw-r--r-- | libqpdf/QPDFAcroFormDocumentHelper.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libqpdf/QPDFAcroFormDocumentHelper.cc b/libqpdf/QPDFAcroFormDocumentHelper.cc index 256fa694..ad6efc70 100644 --- a/libqpdf/QPDFAcroFormDocumentHelper.cc +++ b/libqpdf/QPDFAcroFormDocumentHelper.cc @@ -1002,8 +1002,10 @@ QPDFAcroFormDocumentHelper::transformAnnotations( } // Merge the other document's /DR, creating a conflict // map. mergeResources checks to make sure both objects - // are dictionaries. - from_dr.makeResourcesIndirect(*from_qpdf); + // are dictionaries. By this point, if this is foreign, + // from_dr has been copied, so we use the target qpdf as + // the owning qpdf. + from_dr.makeResourcesIndirect(this->qpdf); dr.mergeResources(from_dr, &dr_map); if (from_afdh->getNeedAppearances()) |