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
This commit is contained in:
Timothy Flynn 2023-11-08 13:58:44 -05:00 committed by Sam Atkins
parent e576bf975c
commit a098b6e371
Notes: sideshowbarker 2024-07-17 05:05:51 +09:00

View file

@ -526,7 +526,7 @@ ErrorOr<GPOS> GPOS::from_slice(ReadonlyBytes slice)
TRY(stream.seek(header.lookup_list_offset, SeekMode::SetPosition));
auto const& lookup_list = *TRY(stream.read_in_place<LookupList const>());
auto lookup_records = TRY(stream.read_in_place<Offset16>(lookup_list.lookup_count));
auto lookup_records = TRY(stream.read_in_place<Offset16 const>(lookup_list.lookup_count));
return GPOS { slice, header, script_list, script_records, feature_list, feature_records, lookup_list, lookup_records };
}