1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:38:10 +00:00

LibPDF: Reject CFFs with more than one font

The code assumes that there's just one Top DICT, so let's be loud
when that isn't the case.
This commit is contained in:
Nico Weber 2023-10-12 10:20:54 -04:00 committed by Andreas Kling
parent 8388fe51b5
commit c825194fb9

View file

@ -64,6 +64,9 @@ PDFErrorOr<NonnullRefPtr<CFF>> CFF::create(ReadonlyBytes const& cff_bytes, RefPt
return TRY(font_names.try_append(font_name));
}));
if (font_names.size() != 1)
return error("CFFs with more than one font not yet implemented");
auto cff = adopt_ref(*new CFF());
cff->set_font_matrix({ 0.001f, 0.0f, 0.0f, 0.001f, 0.0f, 0.0f });