It's true that blob->as<> should only be called on null or sanitized
data. But this change is safe, so keep it.
template <typename Type>
inline const Type* as (void) const
{
- return unlikely (!data) ? &Null(Type) : reinterpret_cast<const Type *> (data);
+ return length < Type::min_size ? &Null(Type) : reinterpret_cast<const Type *> (data);
}
inline hb_bytes_t as_bytes (void) const
{
protected:
UnsizedArrayOf<HBUINT8> dataZ; /* Location data. */
+ public:
DEFINE_SIZE_ARRAY (0, dataZ);
};
protected:
UnsizedArrayOf<HBUINT8> dataZ; /* Glyphs data. */
-
+ public:
DEFINE_SIZE_ARRAY (0, dataZ);
};