feat(libSceFreeTypeOt): read Mac resource fork headers and data offsets #15050
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15050"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by noamroger on 2026-11-02T12:33:32Z.
What
Implements two of the three Mac resource fork exports of libSceFreeTypeOt,
FT_Raccess_Get_HeaderInfo(p5GNJaXO2yE) andFT_Raccess_Get_DataOffsets(hF3stKUWbWg), which weresceFreeTypeOtUnknown_*stubs. Both follow FreeType 2.4.12src/base/ftrfork.con the existing Ot streams (FT_Stream_Seek/Read/Skip/ReadUShort/ReadLong) andft_mem_realloc/ft_mem_free, so the guest memory callbacks see the same allocations as in FreeType (16-byte reference array, freed;FT_Longoffsets array, returned to the caller).The Ot exports already date this FreeType to 2.4.11-2.4.12 (
FT_Sqrt32,FT_Property_Set), soFT_Raccess_Get_DataOffsetstakes the seven arguments of that version;sort_by_res_idonly appeared in 2.5.3. That risk, the inputs where 2.4.12 has undefined behaviour (header field with the top bit set,FT_Longoverflow) and duplicate resource IDs with different offsets (unspecifiedft_qsortorder) throw and are recorded indocs/dev/debt/libSceFreeTypeOt.md.FT_Raccess_Guess(8cnVx1yH9-I) keeps throwing: it opens sibling files through path rules.Tested
Linux (Ubuntu 24.04, g++ 13): new
GuestFreeTypeOtRaccesstest built againstStream.cpp,src/Memory.cppandsrc/Raccess.cpp, also with-fsanitize=address,undefined: fork at offset 0 and 0x80 with a copied and a zeroed map header, references sorted by ID with the attribute byte dropped, missing tag (Cannot_Open_Resource, nothing written or allocated), data/map length mismatch, mismatching map header and empty map (Unknown_File_Format,rdata_poswritten first as in FreeType), short and out-of-range streams (Invalid_Stream_Operation), and a cut reference list (count written, reference array freed).tools/check_conventions.py --base upstream/mainandtest_public_headers.py --audit-onlypass.tools/pr_overlap.pycannot reach the GitHub API from my environment; I checked by NID that no open pull request changesp5GNJaXO2yE,hF3stKUWbWgor8cnVx1yH9-I.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Generated with Claude Code