2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-23 11:28:56 +00:00

Bug fix - don't ignore non-dictionary objects when searching for the

linearization parameter dictionary.

Spec states that that linearization parameter dictionary must be the first
object.
This commit is contained in:
m-holger 2024-11-02 14:28:24 +00:00
parent f92368f44f
commit 7e38c952e6

View File

@ -111,8 +111,7 @@ QPDF::isLinearized()
QPDFTokenizer::Token t1 = readToken(*m->file); QPDFTokenizer::Token t1 = readToken(*m->file);
if (t1.isInteger() && readToken(*m->file).isInteger() && if (t1.isInteger() && readToken(*m->file).isInteger() &&
readToken(*m->file).isWord("obj") && readToken(*m->file).isWord("obj")) {
readToken(*m->file).getType() == QPDFTokenizer::tt_dict_open) {
lindict_obj = toI(QUtil::string_to_ll(t1.getValue().c_str())); lindict_obj = toI(QUtil::string_to_ll(t1.getValue().c_str()));
} }
pos = buffer.find_first_not_of("0123456789"sv, pos); pos = buffer.find_first_not_of("0123456789"sv, pos);