Commit 972cbf103da10df7d2dd89313b4ce985a1b06ab8

Authored by m-holger
1 parent a1fe40a4

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

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