In QPDF::processXRefStream avoid inserting objed id 0 into the xref table

This commit is contained in:
m-holger 2024-04-30 10:38:59 +01:00
parent a1fe40a4f0
commit 972cbf103d
1 changed files with 1 additions and 2 deletions

View File

@ -1117,8 +1117,7 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj)
if (obj == 0) {
// This is needed by checkLinearization()
m->first_xref_item_offset = xref_offset;
}
if (fields[0] == 0) {
} else if (fields[0] == 0) {
// Ignore fields[2], which we don't care about in this case. This works around the issue
// of some PDF files that put invalid values, like -1, here for deleted objects.
insertFreeXrefEntry(QPDFObjGen(obj, 0));