2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-03 07:12:28 +00:00

Fix QPDF::copyForeignObject warning

Provide correct obj_gen and offset.
This commit is contained in:
m-holger 2024-11-07 13:49:41 +00:00
parent 54cf0e519c
commit 264d4082e4
2 changed files with 6 additions and 3 deletions

View File

@ -677,8 +677,11 @@ QPDF::copyForeignObject(QPDFObjectHandle foreign)
auto og = foreign.getObjGen(); auto og = foreign.getObjGen();
if (!obj_copier.object_map.count(og)) { if (!obj_copier.object_map.count(og)) {
warn(damagedPDF("unexpected reference to /Pages object while copying foreign object; " warn(damagedPDF(
"replacing with null")); "foreign object " + og.unparse(' '),
foreign.getParsedOffset(),
"unexpected reference to /Pages object while copying foreign object; replacing with "
"null"));
return QPDFObjectHandle::newNull(); return QPDFObjectHandle::newNull();
} }
return obj_copier.object_map[foreign.getObjGen()]; return obj_copier.object_map[foreign.getObjGen()];

View File

@ -1,2 +1,2 @@
WARNING: minimal.pdf (object 6 0, offset 556): unexpected reference to /Pages object while copying foreign object; replacing with null WARNING: minimal.pdf (foreign object 2 0, offset 768): unexpected reference to /Pages object while copying foreign object; replacing with null
test 25 done test 25 done