From 7e38c952e6bf8d7fc93d1fb70dc57f7908da5a47 Mon Sep 17 00:00:00 2001 From: m-holger Date: Sat, 2 Nov 2024 14:28:24 +0000 Subject: [PATCH] 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. --- libqpdf/QPDF_linearization.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc index 531fdc84..70b29e71 100644 --- a/libqpdf/QPDF_linearization.cc +++ b/libqpdf/QPDF_linearization.cc @@ -111,8 +111,7 @@ QPDF::isLinearized() QPDFTokenizer::Token t1 = readToken(*m->file); if (t1.isInteger() && readToken(*m->file).isInteger() && - readToken(*m->file).isWord("obj") && - readToken(*m->file).getType() == QPDFTokenizer::tt_dict_open) { + readToken(*m->file).isWord("obj")) { lindict_obj = toI(QUtil::string_to_ll(t1.getValue().c_str())); } pos = buffer.find_first_not_of("0123456789"sv, pos);