2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 03:40:53 +00:00

Change QPDF::copyForeignObject to return a null object when called with a /Pages object (fixes #1011)

This commit is contained in:
m-holger 2023-07-25 14:34:14 +01:00
parent 5d6ee83e3f
commit fedd42191f

View File

@ -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