mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00:00
LibPDF: Assert compressed xref's 2nd field is non-zero
This commit is contained in:
parent
f9c1d11380
commit
bfd8faedf9
1 changed files with 2 additions and 0 deletions
|
@ -387,6 +387,8 @@ PDFErrorOr<NonnullRefPtr<XRefTable>> DocumentParser::parse_xref_stream()
|
||||||
auto field_sizes = TRY(dict->get_array(m_document, "W"));
|
auto field_sizes = TRY(dict->get_array(m_document, "W"));
|
||||||
if (field_sizes->size() != 3)
|
if (field_sizes->size() != 3)
|
||||||
return error("Malformed xref dictionary");
|
return error("Malformed xref dictionary");
|
||||||
|
if (field_sizes->at(1).get_u32() == 0)
|
||||||
|
return error("Malformed xref dictionary");
|
||||||
|
|
||||||
auto highest_object_number = dict->get_value("Size").get<int>() - 1;
|
auto highest_object_number = dict->get_value("Size").get<int>() - 1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue