1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-28 16:07:14 +00:00

harfbuzz: Update to 8.4.0

This commit is contained in:
Rémi Verschelde
2024-04-05 10:35:10 +02:00
parent f6a78f83aa
commit 8fcc7a52dc
75 changed files with 2291 additions and 619 deletions

View File

@@ -41,10 +41,21 @@ using namespace OT;
using objidx_t = hb_serialize_context_t::objidx_t;
using whence_t = hb_serialize_context_t::whence_t;
/* utility macro */
template<typename Type>
static inline const Type& StructAtOffsetOrNull (const void *P, unsigned int offset)
{ return offset ? StructAtOffset<Type> (P, offset) : Null (Type); }
/* CFF offsets can technically be negative */
template<typename Type, typename ...Ts>
static inline const Type& StructAtOffsetOrNull (const void *P, int offset, hb_sanitize_context_t &sc, Ts&&... ds)
{
if (!offset) return Null (Type);
const char *p = (const char *) P + offset;
if (!sc.check_point (p)) return Null (Type);
const Type &obj = *reinterpret_cast<const Type *> (p);
if (!obj.sanitize (&sc, std::forward<Ts> (ds)...)) return Null (Type);
return obj;
}
struct code_pair_t
{