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

Bug fix - in QPDF::isLinearized return false if /L is not an integer

This commit is contained in:
m-holger 2024-11-02 15:16:47 +00:00
parent 2e3f54e616
commit 12f7698ea1

View File

@ -128,18 +128,17 @@ QPDF::isLinearized()
return false; return false;
} }
QPDFObjectHandle L = candidate.getKey("/L"); auto L = candidate.getKey("/L");
if (L.isInteger()) { if (!L.isInteger()) {
return false;
}
qpdf_offset_t Li = L.getIntValue(); qpdf_offset_t Li = L.getIntValue();
m->file->seek(0, SEEK_END); m->file->seek(0, SEEK_END);
if (Li != m->file->tell()) { if (Li != m->file->tell()) {
QTC::TC("qpdf", "QPDF /L mismatch"); QTC::TC("qpdf", "QPDF /L mismatch");
return false; return false;
} else { }
m->linp.file_size = Li; m->linp.file_size = Li;
}
}
m->lindict = candidate; m->lindict = candidate;
return true; return true;
} }