From a098b6e371f3f794a0a43b259cf7aa0b2f9bbe73 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 8 Nov 2023 13:58:44 -0500 Subject: [PATCH] LibGfx: Ensure const-correctness when reading from the GPOS byte stream Otherwise, the call to `read_in_place` gives the following error: Tried to obtain a non-const span from a read-only FixedMemoryStream --- Userland/Libraries/LibGfx/Font/OpenType/Tables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/Font/OpenType/Tables.cpp b/Userland/Libraries/LibGfx/Font/OpenType/Tables.cpp index 184590851d..5e5a0a0acb 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/Tables.cpp +++ b/Userland/Libraries/LibGfx/Font/OpenType/Tables.cpp @@ -526,7 +526,7 @@ ErrorOr GPOS::from_slice(ReadonlyBytes slice) TRY(stream.seek(header.lookup_list_offset, SeekMode::SetPosition)); auto const& lookup_list = *TRY(stream.read_in_place()); - auto lookup_records = TRY(stream.read_in_place(lookup_list.lookup_count)); + auto lookup_records = TRY(stream.read_in_place(lookup_list.lookup_count)); return GPOS { slice, header, script_list, script_records, feature_list, feature_records, lookup_list, lookup_records }; }