Merge pull request #15050 from noamroger/claude/project-thread-od3mt9

feat(libSceFreeTypeOt): read Mac resource fork headers and data offsets
This commit is contained in:
Dean authored and GitHub committed 2026-11-05 21:46:48 +13:00
commit f09613011b
7 files changed
+376 -11

No files matched your search

+3 -1
View File
@@ -1,7 +1,7 @@
# libSceFreeTypeOt technical debt
- The FT_Glyph_Copy, FT_Outline_Get_Orientation, FT_Request_Size, FT_Sin, FT_Tan, FT_Vector_Unit, FT_New_Size, FT_Outline_Copy, FT_Outline_Decompose, FT_Stroker_New, FT_Stroker_Done, FT_Stroker_GetCounts, FT_Stroker_BeginSubPath, FT_Stroker_LineTo, FT_Stroker_EndSubPath, FT_Stroker_Set, FT_Stroker_Rewind, FT_Stroker_GetBorderCounts, FT_Stroker_ConicTo and FT_Stroker_CubicTo NIDs in [Export.cpp](../../../core/libs/prx/libSceFreeTypeOt/Export.cpp) are identified, but their provider-specific prototypes and behavior remain unverified. Their named helpers retain the explicit inventory aliases and throw; the separate libSceFreeType implementations do not supply this provider.
- The 68 `sceFreeTypeOtUnknown_*_nid_no_patch` exports in [Export.cpp](../../../core/libs/prx/libSceFreeTypeOt/Export.cpp) are present in the PS5 3.20 export inventory from [PS5-3.20_Libs](https://github.com/DNNDHH/PS5-3.20_Libs). Their prototypes and behavior are unverified. Each uses the no-parameter import-resolution convention and throws through `NotImplemented_nid_no_patch`; these declarations make no ABI or behavior claim.
- The 66 `sceFreeTypeOtUnknown_*_nid_no_patch` exports in [Export.cpp](../../../core/libs/prx/libSceFreeTypeOt/Export.cpp) are present in the PS5 3.20 export inventory from [PS5-3.20_Libs](https://github.com/DNNDHH/PS5-3.20_Libs). Their prototypes and behavior are unverified. Each uses the no-parameter import-resolution convention and throws through `NotImplemented_nid_no_patch`; these declarations make no ABI or behavior claim.
### Unknown function info
- [FT_Outline_GetInsideBorder, FT_Outline_GetOutsideBorder](../../../core/libs/prx/libSceFreeTypeOt/CMakeLists.txt) (libSceFreeTypeOl, libSceFreeTypeOt) - console prototypes, enum/layout equivalence, FreeType configuration and module/library versions are unverified. The existing LP64 outline layout and unsigned 16-bit counts follow bundled FreeType 2.13.3; border selection follows [ftstroke.c](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftstroke.c), with the shifted polygon area from [ftoutln.c](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftoutln.c) accumulated in 64 bits. Null positive-count arrays and out-of-range or non-increasing contour endpoints throw when reached; their console behavior is unknown. Tags and flags are not read, and input arrays remain caller-owned.
@@ -19,3 +19,5 @@
- [ft_mem_alloc, ft_mem_qalloc, ft_mem_realloc, ft_mem_qrealloc, ft_mem_free, ft_mem_dup, ft_mem_strdup, ft_mem_strcpyn](../../../core/libs/prx/libSceFreeTypeOt/src/Memory.cpp) (libSceFreeTypeOt) - the exports carry the NIDs of these FreeType names; console prototypes and FreeType version equivalence are unverified. The LP64 signatures, the guest `FT_MemoryRec` callbacks and the error codes (Invalid_Argument 0x06, Array_Too_Large 0x0A, Out_Of_Memory 0x40) follow FreeType 2.4.12 [ftutil.c](https://github.com/freetype/freetype/blob/cecf93ef90c660a8b0b45e5adbbfb5ea443fb6b9/src/base/ftutil.c#L49-L221). Bundled FreeType 2.13.3 differs only in `ft_mem_qrealloc` from a count of 0, which it does not zero. As in a release build, `ft_mem_qrealloc` does not check the `FT_ASSERT` that a block with no current items is null. The current byte size passed to `realloc` wraps where the source's signed product would overflow.
- [FT_Sin, FT_Tan, FT_Vector_Unit, FT_Outline_Get_Orientation, FT_Outline_Copy, FT_Outline_Decompose](../../../core/libs/prx/libSceFreeTypeOt/CMakeLists.txt) (libSceFreeTypeOt) - built from the 2.13.3-based libSceFreeType sources; the provider is dated to 2.4.11-2.4.12 elsewhere and its version is unmeasured. Against [2.4.12](https://github.com/freetype/freetype/blob/cecf93ef90c660a8b0b45e5adbbfb5ea443fb6b9/src/base/ftoutln.c): `FT_Outline_Copy` returns `Invalid_Outline`, not `Invalid_Argument`, for a null outline; `FT_Outline_Get_Orientation` returns `FT_ORIENTATION_NONE` for a zero-width or zero-height box and beyond ±0x1000000, and shifts coordinates rather than differences; counts of 0x8000 or more are not negative `short`s. 2.4.11 does not shift the area and uses other CORDIC constants than the 2.4.12 ones used here. FT_Cos and FT_Angle_Diff are also exported but absent from the 3.20 inventory.
- [FT_Raccess_Get_HeaderInfo, FT_Raccess_Get_DataOffsets](../../../core/libs/prx/libSceFreeTypeOt/src/Raccess.cpp) (libSceFreeTypeOt) - console prototypes and FreeType version equivalence are unverified. Both follow 2.4.12 [ftrfork.c](https://github.com/freetype/freetype/blob/cecf93ef90c660a8b0b45e5adbbfb5ea443fb6b9/src/base/ftrfork.c#L49-L237) and read only `memory` from the library record. `FT_Raccess_Get_DataOffsets` takes the seven arguments of 2.4.11-2.5.2; from 2.5.3 `FT_Bool sort_by_res_id` precedes `offsets`. Header fields with the top bit set and overflowing `FT_Long` sums, undefined in that source, throw; 2.13.3 adds overlap, stream size and count checks that 2.4.12 lacks. Equal resource IDs with different offsets throw, since `ft_qsort` leaves their order unspecified. Null pointers throw where 2.4.12 dereferences them. `FT_Raccess_Guess` still throws.