mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-31 02:48:31 +00:00
Change QPDF::copyForeignObject to return a null object when called with a /Pages object (fixes #1011)
This commit is contained in:
parent
5d6ee83e3f
commit
fedd42191f
@ -2026,7 +2026,13 @@ QPDF::copyForeignObject(QPDFObjectHandle foreign)
|
||||
}
|
||||
obj_copier.to_copy.clear();
|
||||
|
||||
return obj_copier.object_map[foreign.getObjGen()];
|
||||
auto& result = obj_copier.object_map[foreign.getObjGen()];
|
||||
if (!result.isInitialized()) {
|
||||
result = QPDFObjectHandle::newNull();
|
||||
warn(damagedPDF("Unexpected reference to /Pages object while copying foreign object. "
|
||||
"Replacing with Null object."));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user