From 32f601f9a4ef872b353442696768863ba89b827b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 8 Feb 2024 07:50:02 -0500 Subject: [PATCH] LibPDF: Fix small bug from #21452 I implemented CFF charset format 2 in 6f783929dd0 with the note "I haven't seen this being used in the wild". Now that I have seen it (0000658.pdf), I can say that this has never worked, despite me claiming "it's easy to implement". But now it works! --- Userland/Libraries/LibPDF/Fonts/CFF.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibPDF/Fonts/CFF.cpp b/Userland/Libraries/LibPDF/Fonts/CFF.cpp index ba850c5882..44b28429a6 100644 --- a/Userland/Libraries/LibPDF/Fonts/CFF.cpp +++ b/Userland/Libraries/LibPDF/Fonts/CFF.cpp @@ -763,7 +763,7 @@ PDFErrorOr> CFF::parse_charset(Reader&& reader, size while (names.size() < glyph_count - 1) { // CFF spec, "Table 21 Range2 Format" auto first_sid = TRY(reader.try_read>()); - int left = TRY(reader.try_read()); + int left = TRY(reader.try_read>()); for (SID sid = first_sid; left >= 0 && names.size() < glyph_count - 1; left--, sid++) TRY(names.try_append(resolve_sid(sid, strings))); }