1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

LibTTF: Use ByteBuffer::copy() since wrap() was removed

This commit is contained in:
Stephan Unverwerth 2020-12-29 16:12:19 +01:00 committed by Andreas Kling
parent 222b7f6c87
commit 9689d914b4
3 changed files with 3 additions and 5 deletions

View file

@ -90,8 +90,7 @@ Optional<Cmap::Subtable> Cmap::subtable(u32 index) const
u16 encoding_id = be_u16(m_slice.offset_pointer(record_offset + (u32)Offsets::EncodingRecord_EncodingID));
u32 subtable_offset = be_u32(m_slice.offset_pointer(record_offset + (u32)Offsets::EncodingRecord_Offset));
ASSERT(subtable_offset < m_slice.size());
// HACK: added const_cast because of new ByteBuffer::wrap behavior, should probably find another workaround
auto subtable_slice = ByteBuffer::wrap(const_cast<u8*>(m_slice.offset_pointer(subtable_offset)), m_slice.size() - subtable_offset);
auto subtable_slice = ByteBuffer::copy(m_slice.offset_pointer(subtable_offset), m_slice.size() - subtable_offset);
return Subtable(subtable_slice, platform_id, encoding_id);
}